J
joesb
joesb said:Instead of voting for multiple "end xxx", I would like to suggest that
more pairs/keyword than "do ... end" and "{ .. }" can be used to define
a block.
For examples:
begin ... end
is ... end
then ... end
Because sometimes, the correct word is not "do". For examples to define
mapping I'd like to do
Brain.learn :cooking is
...
end
rather having "do" there.
It also simplify many semantic in Ruby for example. defining
class/method could be viewed as a method that takes a block. But "do"
wouldn't make sense there, but:
class Person is #<<< just a method taking a block
def say(message) is #<<< Don't know :S
...
end
end
It may make Ruby code reflect more closely to what I am thinking in
word.
To extends it further, may be a syntax for a method to specify what
word they want to use instead of "do". It must be possible to still use
"{}" or "do/end", just that another word can also be used instead.
For example of where "do" isn't the right word (at least for me), look
at Markably and Ezra's Where Plugin.