View Issue Details

IDProjectCategoryView StatusLast Update
0000865LDMud 3.6LPC Languagepublic2023-10-02 16:27
Reporterzesstra Assigned ToGnomi  
PrioritynormalSeverityfeatureReproducibilityN/A
Status resolvedResolutionfixed 
Platformx86_64OSMacOS XOS Version10.9.x
Fixed in Version3.6.7 
Summary0000865: efun is_typeof() to check if a program is inherited
DescriptionEin 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
TagsNo tags attached.

Activities

Gnomi

2018-07-25 17:25

manager   ~0002460

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.

zesstra

2018-07-28 09:30

administrator   ~0002461

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.

Gnomi

2022-10-06 18:23

manager   ~0002689

Upcoming driver version will allow something like: check_type(ob, [object "/obj/table"])

Gnomi

2023-10-02 16:27

manager   ~0002710

Implemented check_type(ob, [object "/obj/table"])

Issue History

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