combining 'constant and 'global for a "standard library

Started by Tim Johnson, April 27, 2008, 12:38:18 PM

Previous topic - Next topic

Tim Johnson

Let's say that I want a 'standard library' with functions available

globally and I _don't_ meself to mistakenly futz with these functions.



Here's what appears to work:

(set 'f '(putb ltrim ltrims)) ;; previously 'defined functions
(apply global f)
(apply constant f)

Brief tests seems to support that this works, but I would welcome

any comments, caveats or other ways to do this.

Thanks

Tim
Programmer since 1987. Unix environment.

Lutz

#1
Think functional: the return value from the 'global' function is the symbol, so it can be used directly by constant ;-)



(map constant (map global '(putb ltrim ltrims)))


see here: http://www.newlisp.org/downloads/newlisp_manual.html#protection">http://www.newlisp.org/downloads/newlis ... protection">http://www.newlisp.org/downloads/newlisp_manual.html#protection

Tim Johnson

#2
Understood. Yes the link says it all...

thanks

tj
Programmer since 1987. Unix environment.