why not just adapt indendation concept from python and forget about these trailing "end"s ? "for loops" are ubuquitous and the trailing end statements makes the code more redundant. infact boiler plate stuff is boring.
On Fri, May 9, 2014 at 9:15 PM, Rayan Ivaturi <[email protected]> wrote: > Yes, but when there are distinct blocks of code and 'end' is just for > marking the close of the block, may be one single 'end' would do. like > > term_freq=Dict{String, Int64}() > for word in english_dictionary > for url in url_list > if search(line, word) != (0:-1) > term_freq[word]=get(term_freq,word,0)+1 > end > > But again this causes lot of confusion both for parser and programmer and > brings in the indentation bites of python... > > Looks like the end clutter can't be removed.. but much preferred over > indentation. > > > On Fri, May 9, 2014 at 3:59 PM, harven <[email protected]> wrote: > >> >> There are some alternative constructs that reduce the `end` noise, e.g. >> >> for word in english_dictionary, url in url_list >> search(line, word) != (0:-1) && >> (term_freq[word]=get(term_freq,word,0)+1) >> end >> >> other examples: >> >> begin >> expression1 >> expression2 >> end >> >> is equivalent to >> >> (expression1; expression2) >> >> if/then/else/end can be written using the ternary operator ?: etc. >> > > > > -- > Regards, > *Rayan Ivaturi*
