Message Pattern examples in Social Machines
A couple examples of messages patterns in my language Social Machines. A huge thanks should go to Phillippe Mougin of Fscript for the inspiration.
AGES := [27. 51. 44. 62. 53. 19. 23. 52. 21.53.35]
"Are they all older than 20"
>> AGES > 20 \ $&
== false
The next example works because Boolean objects implement the '+' behavior, so a Boolean can be added as if True were 1 and False 0.
"How many are over 25 but under 60"
>> AGES > 25 & (AGES < 60) \ $+
== 8
Written by Mark Stahl
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Smalltalk
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#