Re: An elegant, EUPHORIA solution

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

Ya know...I think you've got it!  <G>  Well, a fairly good solution,
anyway.

>constant MY_STRUCTURE =
>   {routine_id("integer"),
>    routine_id("string"),
>    routine_id("user_defined_type")}

    However, that bit won't work.  I did have a version of your type_all()
function called setOf(), that does the same thing.  When creating it, I found
out that you can't call routine_id() on the built-in types.  First you have to
wrap them.

type blah_integer( object v )
   return( integer( v ) )
end type
global constant INTEGER = routine_id( "blah_integer" )

Now you can say something like:
>constant MY_STRUCTURE =
>   {INTEGER,
etc, etc

     The type_structure() routine, however, is brilliant in it's simplicity.
(which is probably why I never thought of it... :)

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

Search



Quick Links

User menu

Not signed in.

Misc Menu