Re: Euphoria vs. C and OOP

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

Don't like this!
need string comparison to access sequence elements (slow)

It would be better to adopt something like c struct as in a previous post.


seqtype address
  sequence first_name
  sequence last_name
  sequence street
  sequence town
end seqtype

then first_name, last_name, etc... would be converted to constant ny the 
parser.


address customer

customer[first_name] = "" -- we keep the [] notation instead of dot notation
                          -- not to forget that in euphoria every is a sequence

     

jacques deschĂȘnes


c.k.lester wrote:
> 
> Or something like this:
> 
> newSequence("addresse")   -- newDatabase
> define_elements(          -- define_fields
>    "addresse" ,
>    {
>       "name_first",
>       "name_last",
>       "street",
>       "town"
>    }
> )
> 
> set("addresse","name_first","Don")
> set("addresse","name_last","Cole")
> 
> That's a simple example and makes the code infinitely flexible.

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

Search



Quick Links

User menu

Not signed in.

Misc Menu