1. Re: routine_id(), etc.

In practice, it's quite easy to get around the restriction to the scoping of
routine_id; instead of writing:

   foo( "bar" ... )

I instead have to write:

   foo( routine_id("bar") ... )

As Robert puts it:

> but it's much less convenient
> than a normal call ...

and this is where I throw up my hands in puzzlement. The construct is
certainly legitimate - programs like Win32Lib would never have been written
without the ability to assign callbacks inside event loops. I invite anyone
thinking otherwise to have a look at the horrible inside-out event loops
inside the EE editor.

He also writes:

> I am still clinging to the somewhat controversial
> belief, that there is maintenance and readability
> value in having the language force everyone to
> order variables and routines such that they are
> defined before they are used.

I have no argument with that. But there are certainly many legitimate cases
where code cannot be written without forward references - for example,
parsers - unless one were to write a *huge* routine. I know; I've had to do
it.

It seems as if Robert begrudges the existance of routine_id, and
intentionally makes it as painful as possible to prevent people from using
it. This is the part that I find irritating, as if I'm continually being
punished for using a construct, despite the fact that the use is perfectly
legitimate.

routine_id had a very difficult birth, experiencing quite a number of
problems - most of them having to do with BIND. Some of these have been
fixed but there are still problems with binding programs that use
routine_id - you have to run FIX.EX on Win32Lib programs if you want to be
able to bind them.


OK, I'm on a roll here, so here are some more puzzlements: why does Euphoria
embrace some C/C++ features, yet reject others?  I'm not trying to 'turn
Euphoria into C', but with routines like:

   printf()
   getc()
   gets()

the C lineage is strong, and it's puzzling that Euphoria deviates some
points - especially when other C/C++ derived languages use them:


[Comments]

Why the {--} instead of {//}? I haven't encountered this as a comment
delimiter in any other language. I have enough trouble not typing {'}.


[Type Names]

Why {integer} and {atom} instead of {int} and {float} or {long}? I'll grant
that {atom} makes sense in terms of distinguishing an object as not being a
{sequence}, but {atom} as a numeric type? I can only assume that {integer}
came to the language as a late optimization, and {atom} remained for
backward compatibility.


[Assignment At Definition]

This one really puzzles me. Euphoria still doesn't allow writing:

   atom a = 12

Euphoria will throw a fatal error if a variable isn't assigned, but makes it
difficult to assign variables, since it has to be done in two seperate
statements. I get the (hopefully mistaken) impression that Robert thinks
that this is likely to result in better code, since the coder can't be lazy
about it.

Personally, I actually write stuff like this all the time, only to have to
go back and change the code when Euphoria reminds me it doesn't support
this.


Some of these may sound petty. I know that Euphoria isn't "C with a few
extra features", but there seems to be little point in being different just
for the sake of being different.

OK, end of tirade...

-- David Cuny

new topic     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu