View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000865 | LDMud 3.6 | LPC Language | public | 2018-07-25 15:54 | 2023-10-02 16:27 |
Reporter | zesstra | Assigned To | Gnomi | ||
Priority | normal | Severity | feature | Reproducibility | N/A |
Status | resolved | Resolution | fixed | ||
Platform | x86_64 | OS | MacOS X | OS Version | 10.9.x |
Fixed in Version | 3.6.7 | ||||
Summary | 0000865: efun is_typeof() to check if a program is inherited | ||||
Description | Ein Wunsch eines Magiers aus dem MG... --- cut here --- wenn ihr mal wieder am Driver baut: so etwas wie is_typeof(object o, str baseloadname) waere cool. Semantik: return objectp(o) && member(program_name+".c", inherit_list(o))>=0; Nur halt nicht so teuer :D | ||||
Tags | No tags attached. | ||||
|
I think the name is too similar to the already existing efun typeof (which handles values, not objects). A name that uses the term 'inherit' instead of 'type' would imho be better. The objectp(ob) part is redundant if the efun accepts only objects as their first parameter. (Anything else then results in a compile or runtime error.) The searched name shall be given as a program name, thus already containing the ".c" ending. So it would basically boil down to member(baseloadname, inherit_list(ob))>=0; But I would think passing an object as the second parameter (and then using its program name) would be okay also. |
|
The name is secondary, I just used it as given in the suggestion. ;-) The basic issue of @Leonidas was the overhead of creating the complete array of inheritees followed with the member(). Agreed, using the program name of a second optional argument would be nice as well. baseof() would also be an idea if not already in use for structs. Although one could accept structs and objects, if adventurous. |
|
Upcoming driver version will allow something like: check_type(ob, [object "/obj/table"]) |
|
Implemented check_type(ob, [object "/obj/table"]) |
Date Modified | Username | Field | Change |
---|---|---|---|
2018-07-25 15:54 | zesstra | New Issue | |
2018-07-25 17:25 | Gnomi | Note Added: 0002460 | |
2018-07-28 09:30 | zesstra | Note Added: 0002461 | |
2021-04-16 19:48 | zesstra | Project | LDMud => LDMud 3.6 |
2022-10-06 18:23 | Gnomi | Assigned To | => Gnomi |
2022-10-06 18:23 | Gnomi | Status | new => assigned |
2022-10-06 18:23 | Gnomi | Note Added: 0002689 | |
2023-10-02 16:27 | Gnomi | Status | assigned => resolved |
2023-10-02 16:27 | Gnomi | Resolution | open => fixed |
2023-10-02 16:27 | Gnomi | Fixed in Version | => 3.6.7 |
2023-10-02 16:27 | Gnomi | Note Added: 0002710 |