Re: Improvements

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

On Mon, 28 Aug 2000, you wrote:
>
>
> Just use one of the syntaxes, not all of them. I don't like the dot nation
> .. Euphoria programs already have a tendacy to have command lines that are
> jjust a bit tooo long. (for example:  x[y][length(p)-2..length(p)]  etc)
>
> But then again, you don't need a new syntax theoretically. Look:
>
> include button.e
>
>  procedure button_foo (integer x)
>     foo (x)
>  end procedure
>
> include otherfile.e
>
>  procedure otherfile_foo (integer x)
>    foo(x)
> end procedure

Well, although I can't really see how an underscore is either better or worse
than a period, the main problem with this approach is twofold:

1. It adds another function call on top of the function already written in the
include file. In loops, this will slow things down considerably. There's also
the extra typing. More chance for errors.

2. Eliminating the "attempt to redefine" error when you have two
globals with the same name, which would be necessary in order for the above to
work, could cause some interesting problems for people who are using existing
libraries. (No more warnings about duplicated variable or function names)

Ideally, the "dot" notation (whatever) shouldn't be required, except in cases
where there is a confirmed conflict. That would let existing code run without
changes.

Perhaps an error message is all that's needed.
  "foo" is defined in button.e
  "foo" is defined in other.e
when there's any question. When you get the error, add the appropriate prefix.
 --
Regards,
Irv

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

Search



Quick Links

User menu

Not signed in.

Misc Menu