Re: RosettaCode

new topic     » goto parent     » topic index » view thread      » older message » newer message
PeteE said...

[*] Or instead of a routine-id, something that can be passed to call_func() that works. Here's my solution:

In 4.0, you can do the override, etc, like this:

 
-- override built-in call_func to accept an object as the routine-id 
override function call_func(object id, sequence args={}) 
  if sequence(id) then 
    for i = length(id) to 1 by -1 do 
      args = { call_func(id[i], args) } 
    end for 
    return args[1] 
  end if 
  return eu:call_func(id, args) -- specify the real built-in 
end function 
 

There's no need for the old_* routine, as you can use the built-in "eu" namespace.

Matt

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu