Re: C-like Structures

new topic     » goto parent     » topic index » view thread      » older message » newer message
mattlewis said...
SDPringle said...

Rather than abandoning EUPHORIA types this could be an extension to the typing system we already have.

I think a better approach might be to keep them separate, but allow memstructs to leverage the type system:

I think I'm leaning towards:

 
type nonnegative_int( object o ) 
    if atom( o ) and o >= 0 then 
        return 1 
    end if 
    return 0 
end type 
 
memstruct nonnegative_point 
 
    -- assignments will be type checked as nonnegative_int 
    unsigned int as nonnegative_int y 
 
end memstruct 

Matt

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

Search



Quick Links

User menu

Not signed in.

Misc Menu