Re: Feature creep

new topic     » goto parent     » topic index » view thread      » older message » newer message

CChris wrote:
> 
> c.k.lester wrote:
> 
> > So far with development of 4.0, the only thing I was cautious about was
> > making 'then' and 'do' optional. I would always use those terms simply
> > for maintenance purposes, so my only concern was what if I began using
> > a library that did not use 'then' and 'do?' Could that lead to problems
> > in my own code?
> 
> Zero. The parser stops reading a logical expression as soon as it finds any
> token which would not make sense in a conditional expression at the point it
> is. It will keep doing that.

You didn't answer his question.  Of course the parser could  be capable of
doing that.  But that's only one part of the equation.  The programmer must
also be considered.  We've already had one person tell us about how this
would absolutely cause him problems.
 
> Someone said it would weaken the block structure (how? "if" opens a block,
> not "then"), and at the same time rejected a nice way to make it even more
> visible in code - proper indentation is a good policy, but no one is
> compelled to comply. I must say that I don't quite understand the
> discrepancy.

Yes, I said it.  We must have different definitions of block.  I (nor did
Jason) reject proper indentation.  I guess we assumed (I certainly did) that
since the topic was modifying the interpreter, so were you.  Even so, it's
not uncommon to write multi-line conditionals.  I do sometimes miss putting
an "and" or an "or" between lines (just like Salix's example).

As to the block issue, consider the following:
-- Current syntax:
  if foo then
    puts(1,"foo")
  end if

  -- Optional then syntax:
  if foo
    puts(1,"foo")
  end if

In both cases, the block of code within the if statement is puts(1,"foo").
In the current example, the block is defined by "then" and "end if".  In the
optional example, the block is defined by the end of the logical expression
("foo") and "end if".

In neither case would I consider "foo" to be part of the block.  Nor does
any other language I'm aware of.  In fact, many require you to put the
condition inside parenthesis, which euphoria does not.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu