How do you convert a dynamic type_id to an abstract type_id?

13 views
Skip to first unread message

Finnian Reilly

unread,
Feb 8, 2019, 9:52:03 AM2/8/19
to Eiffel Users
I am looking for a function `x' such that

x. ({INTEGER_32}.type_id) = {REFLECTOR_CONSTANTS}.integer_32_type

but I can't seem to find one

Emmanuel Stapf

unread,
Feb 8, 2019, 10:19:14 AM2/8/19
to Eiffel Users
There is no equivalence between {INTEGER_32}.type_id and
{REFLECTOR_CONSTANTS}.integer_32_type. So if you need to get one from
the other or vice-versa, you need to build a table. For example, in
SED_UTILITIES, there is a mapping and a function to go from the
abstract type ID to the dynamic type ID.

Manu
> --
> You received this message because you are subscribed to the Google Groups "Eiffel Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to eiffel-users...@googlegroups.com.
> Visit this group at https://groups.google.com/group/eiffel-users.
> For more options, visit https://groups.google.com/d/optout.



--
------------------------------------------------------------------------
Eiffel Software
805-685-1006
http://www.eiffel.com
Customer support: http://support.eiffel.com
User group: http://groups.eiffel.com/join
------------------------------------------------------------------------

Finnian Reilly

unread,
Feb 8, 2019, 10:35:30 AM2/8/19
to Eiffel Users
Thanks Manu, I can do that, but I am kind of surprised there isn't one as the reflector constants can be used in an inspect branch.

regards
Finnian

Finnian Reilly

unread,
Feb 8, 2019, 10:51:31 AM2/8/19
to Eiffel Users
Hi Manu,
I don't why you didn't just say
{SED_UTILITIES}.abstract_type

because this function is precisely what I need.

Finnian Reilly

unread,
Feb 8, 2019, 10:58:36 AM2/8/19
to Eiffel Users

I think it would make more sense to put `abstract_type' in INTERNAL rather than SED_UTILITIES. For Eiffel-Loop I have created
class
    EL_INTERNAL

inherit
    INTERNAL

    SED_UTILITIES
       
export
           
{ANY} abstract_type
       
end

end

accessible via {EL_MODULE_EIFFEL}.Eiffel
Reply all
Reply to author
Forward
0 new messages