View Issue Details

IDProjectCategoryView StatusLast Update
0000257LDMud 3.5LPC Compiler/Preprocessorpublic2018-01-30 04:59
ReporterlarsAssigned ToGnomi  
PrioritynormalSeverityfeatureReproducibilityN/A
Status resolvedResolutionfixed 
Target Version3.5.0Fixed in Version3.5.0 
Summary0000257: WIldcarded super calls with arguments
DescriptionShort: Allow wildcarded calls with arguments
From: Lars
Date: 2001-08-02
Type: Feature
State: New

Allow wildcarded calls with arguments, e.g. "*":foo(i).

For this, implement a new opcode ROLLOVER, which takes this stack

   mixed* results = ({ r1, r2, r3 })
   arg1
   arg2
   arg3
   arg4
   r4 <--- sp

and leaves it behind as

   mixed* results = ({ r1, r2, r3, r4 })
   arg1
   arg2
   arg3
   arg4
   arg1
   arg2
   arg3
   arg4 <--- sp

so the sequence could be

   compute arg1
   compute arg2
   compute arg3
   compute arg4
   const0
   rollover
   call fun
   rollover
   call fun
   roll over
   call fun
   ...

With modifications of course.
TagsNo tags attached.

Relationships

duplicate of 0000449 closed LDMud "*"::function() should be able to take parameters 

Activities

Sorcerer

2009-11-23 06:40

updater   ~0001648

Just wanted to bring this issue back to the top, since I intended to post the identical feature request against 3.5.x.

zesstra

2009-11-23 07:26

administrator   ~0001649

I transferred the issue to 3.5. Once we have dealt with it, we should decide if we backport it.

Gnomi

2011-03-06 20:52

manager   ~0002047

Last edited: 2011-03-06 22:09

I plan to implement this in the following way:

New opcodes:
  ARRAY <n>, it's the same as aggregate(<n>), but <n> is put into the program, not on the stack.
  DUP_N <offset> <num>, copies values stack[1-offset-num] ... stack[-offset] on top of the stack.
  PUT_RESULT <offset> <num>, removes the top value off the stack und puts it into the array stack[-offset-1] at position <num>

For three inherited functions and two arguments there would be the following program and the corresponding stack.

ARRAY 3
    ({0,0,0})

SAVE_ARG_FRAME
    ({0,0,0})
    ArgFrame

Compute arguments
    ({0,0,0})
    ArgFrame
    Arg1
    Arg2

SAVE_ARG_FRAME
    ({0,0,0})
    ArgFrame
    Arg1
    Arg2
    ArgFrame

DUP_N 1 2
    ({0,0,0})
    ArgFrame
    Arg1
    Arg2
    ArgFrame
    Arg1
    Arg2

CALL_INHERITED
    ({0,0,0})
    ArgFrame
    Arg1
    Arg2
    ArgFrame
    Result1

PUT_RESULT 4 0
    ({Result1, 0, 0})
    ArgFrame
    Arg1
    Arg2
    ArgFrame

DUP_N 1 2
    ({Result1, 0, 0})
    ArgFrame
    Arg1
    Arg2
    ArgFrame
    Arg1
    Arg2

CALL_INHERITED
    ({Result1, 0, 0})
    ArgFrame
    Arg1
    Arg2
    ArgFrame
    Result1

RESTORE_ARG_FRAME
    ({Result1, 0, 0})
    ArgFrame
    Arg1
    Arg2
    Result1

PUT_RESULT 3 1
    ({Result1, Result2, 0})
    ArgFrame
    Arg1
    Arg2

CALL_INHERITED
    ({Result1, Result2, 0})
    ArgFrame
    Result3

RESTORE_ARG_FRAME
    ({Result1, Result2, 0})
    Result3

PUT_RESULT 0 2
    ({Result1, Result2, Result3})

Gnomi

2011-03-09 00:17

manager   ~0002048

Fix committed in revision da2157dbc0690d11f30a0d0f400eab953adf9d92 to master branch (see changeset 797 for details). Thank you for reporting!

Gnomi

2018-01-29 19:59

manager   ~0002329

Fix committed in revision da2157dbc0690d11f30a0d0f400eab953adf9d92 to master branch (see changeset 1582 for details). Thank you for reporting!

Gnomi

2018-01-29 22:57

manager   ~0002380

Fix committed in revision da2157dbc0690d11f30a0d0f400eab953adf9d92 to master branch (see changeset 2913 for details). Thank you for reporting!

Gnomi

2018-01-30 04:59

manager   ~0002431

Fix committed in revision da2157dbc0690d11f30a0d0f400eab953adf9d92 to master branch (see changeset 3995 for details). Thank you for reporting!

Issue History

Date Modified Username Field Change
2004-11-27 00:09 lars New Issue
2009-11-23 06:40 Sorcerer Note Added: 0001648
2009-11-23 07:25 zesstra Project LDMud => LDMud 3.5
2009-11-23 07:26 zesstra Note Added: 0001649
2010-03-27 06:22 zesstra Target Version => 3.5.0
2011-02-14 00:36 Gnomi Assigned To => Gnomi
2011-02-14 00:36 Gnomi Status new => assigned
2011-02-20 01:50 zesstra Relationship added duplicate of 0000449
2011-03-06 20:52 Gnomi Note Added: 0002047
2011-03-06 22:09 Gnomi Note Edited: 0002047
2011-03-09 00:17 Gnomi Source_changeset_attached => ldmud.git master da2157db
2011-03-09 00:17 Gnomi Note Added: 0002048
2011-03-09 00:17 Gnomi Status assigned => resolved
2011-03-09 00:17 Gnomi Resolution open => fixed
2017-10-04 20:56 zesstra Product Version 3.2.8 and before =>
2017-10-04 20:56 zesstra Fixed in Version => 3.5.0
2018-01-29 19:59 Gnomi Source_changeset_attached => ldmud.git master da2157db
2018-01-29 19:59 Gnomi Note Added: 0002329
2018-01-29 22:57 Gnomi Source_changeset_attached => ldmud.git master da2157db
2018-01-29 22:57 Gnomi Note Added: 0002380
2018-01-30 04:59 Gnomi Source_changeset_attached => ldmud.git master da2157db
2018-01-30 04:59 Gnomi Note Added: 0002431