[Home] [Back to Message Index]

Global SchoolNet - Automated Message Archive

LOGO-L> First-class procedures in Logo




emka@cso.com
Fri, 3 Jan 1997 22:10:34 -0500

Can you write procedures that return other procedures as their values
in LOGO. I thought that define would do this for me but it seems
that it will only create global procedures. I'm new to this and may
be missing the boat but I wanted to try something like this:

to gen.sq
local "fun
define :fun [[x] [:x * :x]]
output :fun
end

to return a function that calculates the square of it's argument.
This didn't work and I couldn't figure out what to try given the
limited documentation I have access to. Is there a way to return a
function in the same way that you do in Scheme when you write a
function that returns a lambda expression?

Thanks, EK

----------------------------------------------------------------------
Eric Kennedy E-mail: emka@cso.com
Disclaimer: opinions expressed by me are my responsibility only.
----------------------------------------------------------------------

---------------------------------------------------------------
Please post messages to the Logo forum to logo-l@gsn.org. Mail
questions about the list administration to logofdn@gsn.org. To
unsubscribe send unsubscribe logo-l to majordomo@gsn.org.