Returning "nothing at all" or a
Posted: Thu Aug 03, 2006 9:19 pm
I like to play at the console.
One thing I noticed at the newLisp console, is that prints and returns frequently run into each other, e.g.
Why the hell is it printing 55??? Well, I found out quite fast, but with a little more complicated values, it may pose a problem.
Right now, I do return a nonintrusive symbol at the end of functions, which are solely meant to be used at the console:
What I would like to have, would be either
- an automatic return value marker, like
- or a way to return something, that isn't printed at all, e.g.
Well, I can live without it ...
Ingo
P.S.: Edited, to get the bbcode markup ...
One thing I noticed at the newLisp console, is that prints and returns frequently run into each other, e.g.
Code: Select all
> (define (test a) (print a))
(lambda (a) (print a))
> (test 5)
55
Right now, I do return a nonintrusive symbol at the end of functions, which are solely meant to be used at the console:
Code: Select all
> (define (test a) (print a) '-)
(lambda (a) (print a) '-)
> (test 5)
5-
- an automatic return value marker, like
Code: Select all
> (define (test a) (print a))
(lambda (a) (print a))
> (test 5)
5
== 5
Code: Select all
> (define (test a) (print a) '-)
(lambda (a) (print a) no-print)
> (test 5)
5
Ingo
P.S.: Edited, to get the bbcode markup ...