1. Re[2]: Why use routine_id?

How about this (suggestion,,, not to break code, and maybe easy to
implement in the parser)

 function add(object x)
  return x + 1
 end function

 object a, b
 a = routine_id("add")

 b = a(123)
 -- instead of: b = call_func(a, {123})

Sorry if this has been discussed before.

______________________________________________

D> ----- Original Message -----
D> From: "Liu Junfeng" <rufi at 163.com>
D> To: "EUforum" <EUforum at topica.com>
D> Sent: Friday, March 21, 2003 8:39 PM
D> Subject: RE: Why use routine_id?


D> [snip]

>> I think the main reason is that Eu doesn't have a function type.
>> In routine_id, a function is really passed as a sequence, and return a
>> integer. I've just forgotten this point.

D> What *ARE* you talking about. This makes no sense at all!

D> Euphoria does have a function type!

D>  function aaa()
D>   return 1
D>  end function

D>  a = routine_id("aaa")

D>  x = call_func(a,{})


D> The NAME of a function/procedure is passed as a parameter to routine_id()
D> and that returns an integer. The integer is an index into an internal table
D> of routines that the program knows about.



D> TOPICA - Start your own email discussion group. FREE!

new topic     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu