For Programmers: Free Programming Magazines  


Home > Archive > Scheme > April 2006 > function that returns a value without an output









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author function that returns a value without an output
Yado8k@gmail.com

2006-04-17, 7:05 pm

hi, I have some functions that I want only the value they returns
without the output how can I do it? It's sorting function and I want to
sort a list (I did it already) but the function wont show anything
about it....

I's somthing with (close-uotput...) but I have no idea how to use it
and were.... waiting for your help, thnx!

Barry Margolin

2006-04-17, 10:02 pm

In article <1145307596.790582.287940@j33g2000cwa.googlegroups.com>,
"Yado8k@gmail.com" <Yado8k@gmail.com> wrote:

> hi, I have some functions that I want only the value they returns
> without the output how can I do it? It's sorting function and I want to
> sort a list (I did it already) but the function wont show anything
> about it....
>
> I's somthing with (close-uotput...) but I have no idea how to use it
> and were.... waiting for your help, thnx!


You don't need to do anything special to prevent output. If the
function never calls a function like write or display, it won't produce
any output.

Maybe you're by the read-eval-print loop that's the interactive
UI of most Scheme implementations. It prints the value returned by the
expression automatically. If you don't want to see it, you can type
something like:

(begin (sorting-function ...) #f)

and it will just print #f.

--
Barry Margolin, barmar@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 ***
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com