[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Expressions as statements
- From: "Soni L." <fakedme@...>
- Date: Fri, 21 Apr 2017 14:43:22 -0300
Why can't I use expressions as statements?
Sure, annotation.annotation ^ function(self, target) ... end isn't very
useful, BUT this would be:
game.mod(modid) ^ function(self)
self.preInit ^ function(event)
(inb4 something about `game.mod[modid] = ...`)
Alternatively, can we extend function calls to take functions?
This wouldn't be as useful as expressions as statements (there's no way
to do game.mod(modid) annotation.typecheck ^ function(self) ... end,
while you could do game.mod(modid) ^ annotation.typecheck ^
function(self) ... end - note that I knew quite well how to exploit ^'s
right-associativity), but would be "good enough" for most use cases.
Disclaimer: these emails may be made public at any given time, with or without reason. If you don't agree with this, DO NOT REPLY.