View Issue Details

IDProjectCategoryView StatusLast Update
0000531LDMud 3.5LPC Compiler/Preprocessorpublic2017-09-30 16:42
ReporterSorcerer Assigned ToGnomi  
PrioritynormalSeverityfeatureReproducibilityalways
Status resolvedResolutionfixed 
Fixed in Version3.5.0 
Summary0000531: Passing varargs argument by reference
DescriptionIt would be great to be able to pass references to functions using varargs arguments for constructs like:

walk_mapping(m, function void (mixed key, varargs mixed *values) { ... })


(I filed this originally as 0000530 against 3.2-dev but it was meant to go here to 3.3, sorry for that)
TagsNo tags attached.

Relationships

child of 0000546 resolvedGnomi Rework lvalue handling 

Activities

zesstra

2008-04-30 03:30

administrator   ~0000609

Yes, actually I had some code yesterday, which contained your example line in the first attempt. ;-)
But I don't know if there is an easy way for doing this. The driver justs puts all the args into an ordinary array and puts that array on the stack. So it would be necessary to allow putting T_LVALUES into arrays. In setup_new_frame2() in interpret.c is the following comment:
* If <allowRefs> is TRUE, references may be passed as extended varargs
* ('(varargs mixed *)'). Currently this is used only for simul efuns.
* TODO: Investigate if holding references in arrays is really such a
* TODO:: a bad thing. Maybe it's just an implementation issue.
* TODO:: This also affects apply_low() and call_lambda().

My current knowledge of the driver code is not deep enough to give a qualified statement if it is 'bad thing'... ;-) Maybe someone else can comment on this one?

BTW: My code yesterday had no need for the arguments to be passed as reference,so I used filter() (map() is ok as well).

Gnomi

2008-06-30 03:10

manager   ~0000624

This one is also for the next unstable branch.

Issue History

Date Modified Username Field Change
2008-02-17 18:56 Sorcerer New Issue
2008-04-30 03:30 zesstra Note Added: 0000609
2008-06-30 03:10 Gnomi Note Added: 0000624
2008-06-30 03:11 Gnomi Status new => assigned
2008-06-30 03:11 Gnomi Assigned To => Gnomi
2008-07-02 01:13 Gnomi Project LDMud 3.3 => LDMud 3.5
2008-07-02 06:13 Gnomi Relationship added child of 0000546
2017-09-30 16:42 Gnomi Status assigned => resolved
2017-09-30 16:42 Gnomi Resolution open => fixed
2017-09-30 16:42 Gnomi Fixed in Version => 3.5.0