|
@@ -179,25 +179,30 @@ if (less a 10) {
|
|
|
$foo
|
|
|
#
|
|
|
|
|
|
-# There are built in functions for getting, setting and invoking the fields
|
|
|
+# There are built in functions for getting, setting the fields and for
|
|
|
+# sending messages to objects in Smalltalk style.
|
|
|
# of object valued types:
|
|
|
-of $door1 name # "red door"
|
|
|
+take $door1 name # "red door"
|
|
|
make $door1 name "green door"
|
|
|
-invoke $door1 open $key
|
|
|
+send $door1 open $key
|
|
|
|
|
|
+# /*-+&|@#'(^!,?.;=~
|
|
|
# Since these three are common, there is syntax available to
|
|
|
-# abbreviate this, using ' or 's or , and ; :
|
|
|
-door1's name # same as (of $door1 name)
|
|
|
-door1's name "green door" # same as (make $door1 name "green door")
|
|
|
-door1, open $key1 # same as invoke $door1 open $key1, open must be a
|
|
|
+# abbreviate this.
|
|
|
+?door1 's name # same as (take $door1 name)
|
|
|
+?name , door1 (take $door1 name)
|
|
|
+@door1's name "green door" # same as (make $door1 name "green door")
|
|
|
+>door1, open $key1 # same as send $door1 open $key1, open must be a
|
|
|
# callable method
|
|
|
|
|
|
-
|
|
|
-# It is possible to define keywords. These get replaced by a single token.
|
|
|
+# Muesli default syntax heavily uses "line noise" characters to signify meaning
|
|
|
+# through a prefix, and has no key words in itself. However, is possible to
|
|
|
+# define keywords. These get replaced by a single token to reduce the line noise.
|
|
|
# This allows to have an English-like or other natural language-like syntax.
|
|
|
-# For example, openDoor above can also be defined as follows:
|
|
|
+# For example, with the default English key word list openDoor above can also
|
|
|
+# be defined as follows:
|
|
|
to openDoor list door Door key Item done Bool do
|
|
|
- if as contains as of a door key so a key so do
|
|
|
+ if as contains as the door's key so a key so do
|
|
|
make a door open true
|
|
|
end
|
|
|
end
|