Re: wishlist : structures

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

Irv wrote:

> ... enumerate

Yeah, that would be a nice addition. Euphoria is a bit odd when it comes to
types. You can't check for a user-declared type. For example:

   window myWindow

declares myWindow to be of the 'type' window, but you can't ever really
_check_ the type. Calling:

   window( myWindow )

runs the type routine, but it just runs *tests* on the parameter, it doesn't
know anything about what type it was declared as.

My guess is that the Euphoria runtime engine doesn't even know about the
user defined types. The code generator probably just uses the type to insert
a call to the type test routine after every assignment.

If that's the case, then you lose type information when you call; the
parameter is "recast" every time you pass it as a parameter.

It would be kind of neat if Euphoria actually allowed you to track the type.
OOPish stuff (and structures are OOPish) would be a lot easier to emulate.

> Associative lists are nice for such things
> as keyword lookups, but please tell me that
> I won't have to store "name" , "addr", ....
> once for each customer "record" I add to my
> customer file.

Point taken.

-- David Cuny

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

Search



Quick Links

User menu

Not signed in.

Misc Menu