R
Rob Peters
Guest
Frederic,
I used the local function with the lambda binding for years already. It is
not necessary to 'funcall' the local function. You can use the local
function as a normal function within a function.
So:
let((mylocalFunc)
myLocalFunc=lambda((arg1 arg2 ...) body...)
; and then call it as usuall
myLocalFunc( arg1 arg2 ...)
; or
test = myLocalFunc(arg1 arg2 ...)
)
Untested but I guess it will work, you can use again 'let' to define local
variables within the local function body (and define again local
functions!)
See the skill language user guide, 'advanced topics', 'assigning a New
Function Binding' to get an idea.
Rob Peters
"Andrew Beckett" <andrewb@DELETETHISBITcadence.com> schreef in bericht
news:3dg5g054kdklu59osfj9nss907hdmise47@4ax.com...
I used the local function with the lambda binding for years already. It is
not necessary to 'funcall' the local function. You can use the local
function as a normal function within a function.
So:
let((mylocalFunc)
myLocalFunc=lambda((arg1 arg2 ...) body...)
; and then call it as usuall
myLocalFunc( arg1 arg2 ...)
; or
test = myLocalFunc(arg1 arg2 ...)
)
Untested but I guess it will work, you can use again 'let' to define local
variables within the local function body (and define again local
functions!)
See the skill language user guide, 'advanced topics', 'assigning a New
Function Binding' to get an idea.
Rob Peters
"Andrew Beckett" <andrewb@DELETETHISBITcadence.com> schreef in bericht
news:3dg5g054kdklu59osfj9nss907hdmise47@4ax.com...
Frederic,
This is exactly what SKILL++ is for. I suggest you do it in SKILL++ rather
than trying to find a tortuous way of doing it in SKILL. In SKILL you can
assign
function objects to variables in let statements:
let((mylocalFunc)
myLocalFunc=lambda((arg list) body...)
; and then call them using funcall:
funcall(myLocalFunc arg1 arg2)
)
but in SKILL++ it's cleaner:
let((local vars)
procedure(myLocalFunc(arg list) body...)
; and then call them
myLocalFunc(arg1 arg2)
) ; let
For a quick intro to SKILL++ look at my article:
http://sourcelink.cadence.com/docs/files/FFF/199/skillpp.html
Regards,
Andrew.
On Fri, 23 Jul 2004 19:05:22 +0200, fogh <adff@CUTTHIS.xs4all.nl> wrote:
Hi All,
Does anyone know how I can define functions locally ?
I would need something like a letfun() macro that will unbind the
function outside the letfun()
In skill,that is. I suppose it is easy to do in skill++
--
Andrew Beckett
Senior Technical Leader
Custom IC Solutions
Cadence Design Systems Ltd