Re: Detecting the Eu version

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

Juergen Luethje wrote:
> 
> Dear EUforum members to whom it may concern:
> 
>    Please don't change the Subject of a thread
>      (unless there is an *important* reason)!
> 
> My e-mail client (and many other clients, too) allows to sort messages
> by Subject, that makes it much easier to read this mailing list.
> Also, RDS had built a useful feature into the EUforum web interface:
> After clicking at the Subject of a message, you'll get the whole thread.
> Even if you are not interested in these possibilities yourself, other
> people here find them useful, so do not destroy them!
> 
> -> I changed "(no subject)" back to "Detecting the Eu version".

Agreed.  I usually only change the subject title when a thread forks to a
different subject but then I put something like [was: whatever].

> However, starting with Eu 2.5, the problem has changed. A version()
> function -- builtin or not -- wouldn't solve the problem any more. For
> the Eu 2.5 interpreter (as it currently is) *there is no other way than
> crashing*, when it will try to run source code that contains keywords
> which were introduced in Eu 2.6 or later.
> Whatever code you write in order to try to solve this problem, your
> code will never be executed, because the program crashes beforehand.
> 
> This has been discussed previously in this thread. So it might be a
> good moment now for some people, to test the cool feature that I
> mentioned above: On the EUforum web interface, click at the subject,
> and read the whole thread ...

Right.  I understood this and tried to clarify it for people who didn't.

So you would do this...
> > Euphoria is small enough, I think, to include the required interpreter
> > and files to users.  Also, binding or translating would work.  For open
> > source, you would just distribute a source tree like any other
> > (executable) project would.


> > The real problem, of course, comes in distributing libraries that you
> > don't want to work only for the lowest common denominator.  Libraries
> > are the code that need to check versions somewhat reliably so they can
> > give a meaningful message to the user of the library.
> 
> Right!
> 
> > (Of course, if the library user would read the docs...)
> 
> Are we talking about a low-level or a high-level language?
> If Euphoria is a high-level language, then it should for instance say
> something like:
> 
>    Sorry, code in "thisprog.e" requires Euphoria version 2.5 or later.
> 
> Rather than:
> 
>    syntax error - expected to see an expression, not an
>    illegal character
>    s = s[2..$]
>              ^
> Regards,
>    Juergen

Obviously this would be the *best* solution.  I don't have much hope for its
implementation.

The 'with 2.5' or whatever would have to be executed before the entire program
is parsed.  It would have to be a compiler directive.  Versions prior to 2.5
might still break as mentioned earlier in the thread but we would at least solve
the problem for future versions.

> -- 
> Have you read a good program lately?
> 
> 


=====================================
Too many freaks, not enough circuses.

j.

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

Search



Quick Links

User menu

Not signed in.

Misc Menu