Re: Aliases for function names?

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

I was wondering, is it possible to define aliases for function names, so that I may have something like the following:

a=ParticularlyLongFunctionName

x=a(var1)

I guess this feature would require anonymous functions, or high order functions. Is something of this sort supported in Euphoria?

Yes, something like this supported already.

All one has to do is create a shim function and so long as it is very small, it will get in-lined as if you had actually coded the full-name function. For example ...

function a(object arg) 
   return ParticularlyLongFunctionName( arg ) 
end function 
x=a(var1) 

The generated code for this is functionally identical to ...

x=ParticularlyLongFunctionName( var1 ) 
new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu