Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

scheme stack allocation

0 views
Skip to first unread message

joesch...@gmail.com

unread,
Feb 11, 2008, 7:38:48 PM2/11/08
to
I have a few problems I cant figure out, If anyone could help, that
would be great!

Define a scheme function with a parameter that can safely be stack
allocated. Justify your answer.

Define a scheme function with a parameter that cannot safely be stack
allocated. Justify your answer.

Describe an analysis that could be applied to a scheme function to
determine if it is safe to stack allocate its parameters. Keep in mind
that function s can call other functions, passing their parameters as
arguments.

Barry Margolin

unread,
Feb 12, 2008, 12:28:34 AM2/12/08
to
In article
<266e3426-a208-41ce...@l1g2000hsa.googlegroups.com>,
joesch...@gmail.com wrote:

Sorry, we're not going to do your homework for you. Tell us how far
you've gotten, and what's confusing you, and people will then help fill
in the blanks.

--
Barry Margolin, bar...@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***

Aaron Hsu

unread,
Feb 12, 2008, 11:48:04 PM2/12/08
to
On 2008-02-11 23:28:34 -0600, Barry Margolin <bar...@alum.mit.edu> said:

> Sorry, we're not going to do your homework for you. Tell us how far
> you've gotten, and what's confusing you, and people will then help fill
> in the blanks.

You would think that he would post something that didn't look so
blatantly like homework.

--
Aaron Hsu <arc...@sacrideo.us>
http://www.sacrideo.us

Jens Axel Soegaard

unread,
Feb 13, 2008, 4:23:28 AM2/13/08
to
joesch...@gmail.com skrev:

How many stacks do we have?

--
Jens Axel Søgaard

Barry Margolin

unread,
Feb 13, 2008, 6:01:26 PM2/13/08
to
In article <2008021222480416807-arcfide@sacrideous>,
Aaron Hsu <arc...@sacrideo.us> wrote:

> On 2008-02-11 23:28:34 -0600, Barry Margolin <bar...@alum.mit.edu> said:
>
> > Sorry, we're not going to do your homework for you. Tell us how far
> > you've gotten, and what's confusing you, and people will then help fill
> > in the blanks.
>
> You would think that he would post something that didn't look so
> blatantly like homework.

Are you new to Usenet? It's really not that uncommon for posters to
quote the problem set verbatim.

Aaron Hsu

unread,
Feb 14, 2008, 3:42:20 AM2/14/08
to
On 2008-02-13 17:01:26 -0600, Barry Margolin <bar...@alum.mit.edu> said:

> Are you new to Usenet? It's really not that uncommon for posters to
> quote the problem set verbatim.

I am not new, but actually, I haven't seen a lot of these cases where
it was so blatant.

Jed Davis

unread,
Feb 14, 2008, 2:57:30 PM2/14/08
to
joesch...@gmail.com writes:

> Define a scheme function with a parameter that can safely be stack
> allocated. Justify your answer.

Anything can be stack-allocated; it just might have to be moved later.
See, canonically, http://home.pipeline.com/~hbaker1/CheneyMTA.html

--
#!/usr/bin/env scheme-script
#!r6rs (import (rename (rnrs) (lambda \x3bb;) (set! \x5316;))) ((\x3bb;
':['"JdDvs" '"e ai\n"]) (\x3bb; (\x3a3;) (\x3bb; (set!) (string-for-each
(\x3bb; (\x3c7;) (display \x3c7;) (\x5316; set! (call/cc set!))) \x3a3;)))-)

Abdulaziz Ghuloum

unread,
Feb 14, 2008, 3:23:42 PM2/14/08
to
Jed Davis wrote:

<quote>


#!/usr/bin/env scheme-script
#!r6rs (import (rename (rnrs) (lambda \x3bb;) (set! \x5316;))) ((\x3bb;
':['"JdDvs" '"e ai\n"]) (\x3bb; (\x3a3;) (\x3bb; (set!) (string-for-each
(\x3bb; (\x3c7;) (display \x3c7;) (\x5316; set! (call/cc set!))) \x3a3;)))-)

</quote>

Or, you can pretty-print it (that won't compromise its unintelligibility
in any way).

(import (rename (rnrs) (lambda λ) (set! 化)))
((λ ': ('"JdDvs" '"e ai\n"))
(λ (Σ)
(λ (set!)
(string-for-each
(λ (χ) (display χ) (化 set! (call/cc set!))) Σ)))
-)

0 new messages