[racket] In rkt or scheme, is there way to refer to the value of last expression?

From: Neil Van Dyke (neil at neilvandyke.org)
Date: Mon Dec 12 19:02:47 EST 2011

J G Cho wrote at 12/12/2011 06:49 PM:
> Just for the readability, is it possible to write
> some-list
> (proc-1 some-list)
> (proc-2 (val-of-last-expression))
> ...
> (proc-n (val-of-last-expression)) ;where n is 'largeish'

If you are interacting in XRepl, you can do this:

You can also define a new "#lang" or syntactic form that does this.  
Whether using this would be more "readable" than nesting the expressions 
the usual way, I could not say.

It might also be the case that these is a better way do solve your 
particular concrete problem, rather than either "largeish N" nested 
procedure applications or breaking the usual syntactic clarity of Racket.


Posted on the users mailing list.