Open DAddYE opened 11 years ago
as you mentioned in the other issue about having a canonical token for any function, the reason I like def
first is the uniformity it creates along the left, looks pretty nice to me at least, you don't have to lookahead to see what sort of assignment you're dealing with. It definitely does however look kinda awkward to use def
as an expression but I'm all for figuring something nice out there. I also think end
looks really silly for lambdas so part of me doesn't want them at all haha. The thing I love every time I'm writing C is the flat structure, I'd like that to be the norm in Luna as well, vs in js the tendency is to create very nested code since functions are so easy to throw around
Just swinging by here, from a DSL point of view def is pretty distracting. Why not introduce something similar to Ruby's blocks or C# lambdas? Maybe even the Scala style of using _ as placeholder... After all, they will be one liners most of the time.
things like:
can like in
julia
everything be considered as a function itself ? In that casedef(a:int)
can have sense.