Just like Python, Glas (Глас) doesn't really distinguish between dicts, objects or methods/functions. For it functions are just a fancier version of objects which are a fancier version of normal dicts. Later on, during evaluation, Glas makes a distinction, not before though.
I am planning on adding additional features like adding statements after each method call with the ':' operator, like this:
It doesn't care basically if it's encountering a dict ({}), an object, or a function/method.
If it's not a function then it's either a dict OR another object instance. it it's a function it applies it! Glas treats everything as potential functions or procedures (no arguments)
math sin: x
could be _anything_ really :)
Use '$' sign if you wish to refer to function's object explicitly like this:
a function name # could be application?
$ a function name # definitely function object to be referred!
nevermind: that --> listen: this ~ to
# nevermind(that).listen(this.to)
# All you do is complain and whine to your boss,
# slacking, sipping a lot of coffee at the coffeeshop:
complain: and whine -> my ~ boss -> slack: sip coffee: a lot --> coffeeshop
# my.boss.complain(and_whine).slack(
# coffeeshop.sip_coffee(a_lot)
# )
foo: normal dict['some key'] -> bar
I had some kind of a satori Saturday, so it's still just a glas.py file which aims are being a simple as possible translator into Python. (for now it just parses it and evals it like a barbarian, and still not workable ;))
Comments
Afaik my's last' name is equivalent to
my.name['last']
How does the ' operator decide between need for 's and not?
Where is the GitHub page? :-) What did you learn :-) Who are you ?
Nice one
Just like Python, Glas (Глас) doesn't really distinguish between dicts, objects or methods/functions. For it functions are just a fancier version of objects which are a fancier version of normal dicts. Later on, during evaluation, Glas makes a distinction, not before though.
I am planning on adding additional features like adding statements after each method call with the ':' operator, like this:
:D
It doesn't care basically if it's encountering a dict ({}), an object, or a function/method.
If it's not a function then it's either a dict OR another object instance. it it's a function it applies it! Glas treats everything as potential functions or procedures (no arguments) math sin: x could be _anything_ really :)
Use '$' sign if you wish to refer to function's object explicitly like this:
Nevermind that, listen to this:
;)Ah! Yes! :)
I had some kind of a satori Saturday, so it's still just a glas.py file which aims are being a simple as possible translator into Python. (for now it just parses it and evals it like a barbarian, and still not workable ;))
I will make a repo later today, after work.