h1

A syntactic tweak for recursion and function wrapping

November 25, 2010

In most languages

function myfunc(){
..
myfunc()
...
}

is a recursive call. This is  a pity, since  it *could* represent a piece of code that gnerated a new myfunc by calling an old one with some extra functionality , represented by the dots. This can in fact be done with operator overloading, but only if the type signature of the parameter list is changed, which may not be desirable. It can also be done by inheritance in an object context, but again an object context generally requires a modifiable resource, whereas it may be desirable to wrap a pure function

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: