Higher Order functions via Papert Logo

87 views
Skip to first unread message

Gene S.

unread,
Jan 29, 2010, 1:32:05 PM1/29/10
to papertlogo, gene.s...@gmail.com
Hi All,

In response to a need for portable shelter in Haiti in the wake of the
recent quakes a friend sent me a link to a site for the Hexayurt

http://www.appropedia.org/Hexayurt_schematics

I found myself wanting to depict a hexagon with 6 other hexagons
around it to represent a cluster of 7 hexayurts


I recall Logo, in general, being able to deal with higher order
functions ... or so I may have misrembered.
I'd like to have a Papert Logo procedure which draws a hexa_this ,
where the `this' can be a straight line, a triangle, a hexagon ...
whatever the user would like six-of formed into a hexabonal array.

It dawned on me that I might be able to use `run' to evaluate a
procedure, but I didn't notice `run' in the lexicon of Papert Logo.

Anybody got any suggestions or work-arounds for me?

This what I've got so far:
http://logo.twentygototen.org/JIhtRnrD


Sincerely,
Gene

Gene S.

unread,
Jan 29, 2010, 1:57:23 PM1/29/10
to papertlogo

I found Higher order functions for scheme.
http://mitpress.mit.edu/sicp/chapter1/node18.html

Can something similar be done via Papert Logo?

Gene

Thomas Figg

unread,
Jan 29, 2010, 2:07:30 PM1/29/10
to paper...@googlegroups.com
>> I recall Logo, in general, being able to deal with higher order
>> functions ... or so I may have misrembered.
>> I'd like to have a Papert Logo procedure which draws a hexa_this ,
>> where the `this' can be a straight line, a triangle, a hexagon ...
>> whatever the user would like six-of formed into a hexabonal array.
>>
>> It dawned on me that I might be able to use `run' to evaluate a
>> procedure, but I didn't notice `run' in the lexicon of Papert Logo.
>>
>> Anybody got any suggestions or work-arounds for me?

You could add an extra argument and use a series of if statements
to delimit the cases.

to many "type
if :type = "forward [
....
] [
if :type = "other [


] [ ... else. ...]
]
end

> Can something similar be done via Papert Logo?

Functions and variables live in different namespaces in logo,
however we could implement an 'apply' function i.e apply :x a b c to
mean 'call the function in the variable x with args a b c'.

-- tef

Gene Sullivan

unread,
Jan 29, 2010, 2:23:50 PM1/29/10
to papertlogo


2010/1/29 Thomas Figg <thoma...@gmail.com>
<snip>
 
Functions and variables live in different namespaces in logo,
however we could implement an 'apply' function i.e apply :x a b c to
mean 'call the function in the variable x with args a b c'.


Ahhh ... this is what I was looking for!
I've use `apply' in lisp and scheme.
I had looked for `run' as a synonym for lisp's `eval' but had forgot to look for `apply' in Papert Logo lexicon.

Thanks, Thomas.

Gene

 -- tef

--
You received this message because you are subscribed to the Google Groups "papertlogo" group.
To post to this group, send email to paper...@googlegroups.com.
To unsubscribe from this group, send email to papertlogo+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/papertlogo?hl=en.


Reply all
Reply to author
Forward
0 new messages