git clone https://github.com/bhdz/glaslang.git9 karma · joined February 20, 2010
git clone https://github.com/bhdz/glaslang.gitall: standard symbol set:
~ # access, forward (standard)
object ~ property
-> # access, backward ("homosexual" call if you will)
method -> object
->> # access, backward high ("homosexual" call with higher precedence than ~ and ->... very gay...)
some ~ linkage ~ method ->> object
<- # backcall semantics, normal precedence, "tailored" calling
"eenie", "meeenie", "minie", "moe" <- count toes:
take: basket: "apples", "oranges", "bananas" <<- fill basket:
# take(basket().fill_basket("apples",...), ...)
# BE CAREFUL with that code above
# basket doesn't get created with the fruits, just empty basket which
# is subsequently filled with goodies
All these operators can be a different set, but these glyphs are the best in my opinion~ # PS: PLEASE do NOT get offended by my characterization
# of certain method calls as "homosexual"
#
# Don't! This is just for laughs at the language
# I am not against gay community in any way
# and "homosexual" calls are actually the most
# useful feature of this language
#
# Thank you.
so you write:
if: something ~ happened: and: something else ~ happened:
logic ~ did: something ~ happened # ?
and for: x in: range: 12, 32
{{ x }}
this chains the needed things nicely
in fact you can write like this: in: range: 5, 13
perform: a task
for: x in: iter: person
{{ x }} {{ \t, "eject eject eject!" }}
auto destruct: 20s -> space ship
{> user ejected % wait: 20s, any -> input <}
{{ "Your ship explodes in a gigantic fireball!" }}
if: empty: -> input ->> user ejected
{{ "You fail to eject, Ouch!" }}
space ship ~ pilot ~ die: "massive splosion"
space ship ~ destruct: "massive splosion" a space adventure = space ship, blasters, rockets, lasers, *, **: -> Space Ship:
space ship ~ attach weapons: blasters, rockets, lasers:
{{ "Eeeekkrrrrgh! Weapons attached successfully!" }}
{{ "listing:" }}
for weapon in *: #all arguments of attach weapons
{{ "Weapon:", weapon }}
else:
{{ "WARNING! WARNING! Ship weaponry attachment FAILED }}
{{ "You're defenseless!" }}
detach weapons: -> space ship:
{{ "Weaponry detached, seek cover!" }}
else:
{{ "Weaponry detachment FAILED!" }}
{{ \t, "AUTODESTRUCT SEQ. INITIATED" }}
{{ \t, "EJECT EJECT EJECT!" }}
auto destruct: 20s -> space ship 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
;) do something: a dict ['some key'], coordinates['x'] #!/usr/bin/env glas
#
# Yay, and hear these spoken words of wisdom, Stranger:
#
and: he ~ walked: through the valley ~
valley + shadows &
valley + shadows + death -->
and: he ~ feared: not: evil
#
# versus the barbaric cries of the past!
#
#! old pythonic
#
and(
he.walked( through_the_valley.combine(
[valley, shadows], [valley, shadows, death] )
).and( he.feared(not(evil)) )and that's much better than that.much better, don't you think?
cookie adventure: my @ Cookie Monster =
print "Cookie Monster, why is the Cookie jar empty?"
why: my.cookie.jar.empty: @ cookie monster
# why cookie monster, why? :)
why: my.cookie.jar.empty: @ cookie monster .why: "tell me!" and walked: "through the valley"' he's and feared: not: "evil"!
# he.and_walked("through the valley").and_feared(not("evil"))!
drop down:' criminal scum!
# criminal_scum.drop_down()!
eat: breakfast' you!
# you.eat(breakfast)!
kill: with pistol' maim: blunt object' opponent's check dead:
# opponent.maim(blunt_object).kill(with_pistol).check_dead()
print person's name's last
print person's last' name # ;)
# print person.name.last
if my's cookies's jar's empty::
print "Cookie Monster, why is the Cookie jar empty?"
why: cookie jar's empty:' cookie monster
# why cookie monster, why? :)
why: cookie jar's empty:' cookie monster's why: "?"
it's called Glas :)I am planning on adding additional features like adding statements after each method call with the ':' operator, like this:
# ship.attach_weapons(...):
ship's attach weapons: blasters, rockets, lasers:
print "Eeeekkrrrrgh! Weapons attached successfully!"
print "listing:"
for weapon in *: #all arguments of attach weapons
print "Weapon:", weapon
else:
print "WARNING! WARNING! Ship weaponry attachment FAILED"
print "You're defenseless!"
detach weapons:' ship:
print "Weaponry detached, seek cover!"
else:
print "Weaponry detachment FAILED!"
print " AUTODESTRUCT SEQ. INITIATED"
print " EJECT EJECT EJECT!"
auto destruct: 20s' shipI 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.
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!Ytiquette is not written anywhere here, but I suppose it follows Reddiquette guidelines to some extend.
PS: your link (http://www.jackherer.com/chapter04.html) looks like it comes from dubious, tinfoilhat-like source.
PS: Why front(+al) defence? Well, expand the game field a bit more, and put the player into defending strategic locations, let the AI figure a way through... I can imagine giant fields & fortified positions, much like WWI :)
(Or you could christen the game 'Lobotomy')
However, for those interested in model package loading automation, I started a section on reddit: http://www.reddit.com/r/django/comments/d1ulg/automatic_mode..., may be I'm wrong...
Sorry for bothering you...
You must edit models/__init__.py such that:
import X from Y
...and then each model must have class Meta:
app_label = 'foobar'
Without the meta information Django cannot load the models inside the package, it imports only models.py.May be it should be automated (model loader)? For instance, the model loader could parse the directory tree and import all necessary info it needs(meta information, optional), all is needed is a function for it :-/
edit: Format, gramer :)
edit2: Phah! OK. I'm gonna do it. Automatic model loader function, Django extension :) (May be next week...)