Identifiers and Assignment
In mewl, identifiers just look like mew numbers, so be careful when reading/writing mewl programs.
While I was designing mewl identifiers, I was confused about identifiers, I wanted something crazy but usable. So I just decided to go with
mew, but to distinguish numbers from identifiers, I needed something special . Now, please continue.
In mewl, identifiers look something like this ->
So basically, Identifiers follow the same syntax as mew numbers but with a leading
~ (tilde) character.
~mewmewmewmewmew , these all are identifiers.
Assignments are little awkward, it'd be easy to understand with examples:
[=mew [+ mew mew]]
This expression assigns 2 to the variable
~mew and this expression
[:: ~mew] would print the value of variable
~mew (which is 2 )
If you want to assign something to variable, write the identifier with a leading
= (equal sign) without any space(s).
=mew tells the interpreter to evaluate the following expression(s) and store it in variable
[=mewmew [* mewmew mewmew]] would store 9 in a variable which can be accessed via
I know, it is confusing.
[=mewmewmew [+ mew mew [* mewmew mewmew]]]would store 6 to a variable which to be accessed via
[=mewmewmewmewmew [' mew mew mewmew]] [:: ~mewmewmewmewmew]
it would print 112 to stdout
[Info Note]: Assiging something using
=mewmewmewmewmew wouldn't change the meaning of
mewmewmewmewmew as a mew number which still is