Re: Suggestions for ESL (was: Euphoria Standard Library on UBoard)

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

Juergen Luethje wrote:
> > - a mechanism to ignore return-values of functions. Some options:
> >   -> a global variable VOID: VOID = functionToIgnore(...) (like Win32Lib)
> >   -> a procedure ignore that does nothing: ignore(functionToIgnore()) (like
> >   Win4Eu)
> I like both suggestions. Hard to say which one is "better".

I like the ignore-procedure, because it can only be used for ignoring stuff.
The global variable VOID can be used for storing temporary data and can be
passed to other routines, and that's not its purpose. I also think it reads
better. The code just says what it does: it calls a function and 'ignores'
the return value.

> > - an enumeration-mechanism: here's how it was done in Win4Eu:
> >   }}}
<eucode>
> >   constant DAY_OF_WEEK = enum()
> >   constant MONDAY = next(DAY_OF_WEEK),
> >            TUESDAY = next(DAY_OF_WEEK),
> >            WEDNESDAY = next(DAY_OF_WEEK),
> >            THURSDAY = next(DAY_OF_WEEK),
> >            FRIDAY = next(DAY_OF_WEEK),
> >            SATURDAY = next(DAY_OF_WEEK),
> >            SUNDAY = next(DAY_OF_WEEK)
> </eucode>
{{{
</font>
> 
> Sorry, I don't understand.
> Should the function next() be in the library, and the code above is in
> the user's program? Or should all the code above be in the library?

I'm talking about the enum- and next-function. The code above is just an
example of how to use it. It's a higher-level alternative for this:
constant MONDAY = 1,
         TUESDAY = 2,
         WEDNESDAY = 3,
         THURSDAY = 4,
         FRIDAY = 5,
         SATURDAY = 6,
         SUNDAY = 7

The advantage of using enum, is that you can later insert extra values
without having to renumber the existing ones.

> > - advanced C/API-interface functionality (WIN32/LINUX)
> What exactly do you mean?

Euphoria has some basic mechanisms for interfacing with C-code,
(DLL- and SO-files). ESL could contain some more advanced mechanisms
for this. I've seen this kind of functionality implemented in different
libraries, like Win32Lib.

--
The Internet combines the excitement of typing 
with the reliability of anonymous hearsay.

tommy online: http://users.telenet.be/tommycarlier
tommy.blog: http://tommycarlier.blogspot.com

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

Search



Quick Links

User menu

Not signed in.

Misc Menu