Re: Euphoria types of the POLL

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

Hayden McKay wrote:
> 
> I have another idea, not releated to the the question though.
> maybee rob should consider something like this:
> }}}
<eucode>
> 
> -- define some standard euphoria types
> 
> type myInteger  (integer i)  return integer (i) end type
> type myAtom     (atom a)     return atom    (a) end type
> type mySequence (sequence s) return sequence(s) end type
> 
You lost me straightaway. I cannot see why you would need or want to do that.

> -- now here's the idea
> 
> global record myArray     -- create a namespace called myArray
> 
>     age   as myInteger    -- define some fields for da myArray
>     name  as mySequence
>     other as myAtom
> 
> end record
> 
Why would that differ from (say):
record myArray
  integer age
  sequence name
  atom other
end record

Were you to introduce a new "record" construct, the compiler could deduce
exactly the information wanted, without any need to "wrap" the builtin types or
introduce a new "as" syntax. This seems no different to fiddling with the "type"
construct as discussed in the recent poll (variation B2) and remains a pitifully
poor imitation of OOEU-style classes.

Am I mising something here?

Regards,
Pete

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

Search



Quick Links

User menu

Not signed in.

Misc Menu