From: gabriele renzi Date: 2005-08-01T05:41:03+09:00 Subject: Re: Yet Another useless Ruby 2 Idea Stefan Lang ha scritto: > On Sunday 31 July 2005 21:21, gabriele renzi wrote: > >>Hi gurus and nubys, >> >>Hearing about ocaml in the last weeks and having noticed matz' >>hack about using ;; as a block terminator (side by side with >>"end"), I realized that it could be nice if ruby could work the >>same ocaml does WRT to block terminator, I mean, make them optional >>when there is no ambiguity > > [...] > >>it could be cool if ruby could threat this cases as if there was an >>implicit block terminator, like ocaml does, so we could write >> >>class Foo >> def bar(x) >> puts x >> def baz >> puts 'baz' >> Const=:someconstant >>end >> >>instead of >> >>class Foo >> def bar(x) >> puts x >> end >> def baz >> puts 'baz' >> end >> Const=:someconst >>end > > > but it could also mean: > > class Foo > def bar(x) > end > puts x > def baz > end > puts 'baz' > Const=:someconstant > end > > unless indentation is significant. well, I thought that if you wanted to write the equivalent of what you just wrote, you'd just use an explicit block termination (no need for meaningful indentation. Nevertheless, the fact that this was'nt obvious probably shows that this is a bad idea :)