Is there a way to check if an integer is a valid routine_id?

I’ve been playing with types and I’d like to create a type for a routine_id. Something like

type rid(integer id)
    return id >= 0 and 
end type

Does such a thing exist?

Best to ask @petelomax or @ghaberek about that. Or ask on the forum.

The manual doesn’t appear to have any validation function like an is_routine_id(). Something to talk to Greg about. Greg’s not accessible within the Exercism messaging system for some reason so you’ll have to reach him via github

Not in general, no. My own Phix docs have this to say about user defined types. Storing them as say {“rid”,id} may help but would be more awkward to use, then again not difficult to pen a small collection of mini-shims such as call_tfunc(), call_tproc(), etc.

Aside: I might be able to cobble something together for Phix but I don’t know of any way in Euphoria to get my grubby mitts on low-level details such as the compiler’s symbol table.