Re: Re: [writing to files] Error: set-output-port: needs 1 argument(s)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



kkwweett wrote:
>  > One thing that I have noticed is you seem to be using 'cond' when an if
>  > statement would suffice. The cond construct would be more
> appropriate when you
>  > need the equivalent of a C switch statement or multiple if/else.
> 
> SICP tells that one (which one ?!) is a syntactic sugar of the other
> and a good implementation should see things in an equivalent way.

The SICP site states "SICP uses the Scheme dialect of Lisp." I'm not sure how 
this might compare to the version of Scheme defined in the R5RS document. 
Since TinyScheme tries to be compliant with the Scheme standard, I refer to 
the R5RS when questions about Scheme and Scheme syntax arise.

The R5RS lists 'if' as syntax and cond as library syntax. That would make me 
think that cond is the syntactic sugar of if. As you said, they should be 
functionally equivalent based on how you are using 'cond'.

> Personally, I prefer to use cond for there is no need to use the
> keyword 'begin' in (one given) case of successive procedure calls.

You only need begin when one branch of an if contains multiple statements. I 
tend to prefer if statements for simple tests. I mainly raised the issue since 
your script also included if statements. The mix of both cond and if was what 
seemed odd to me. As this is your script so you are free to use whatever 
constructs you choose. :-)

-- 
Cheers!

Kevin.

http://www.ve3syb.ca/           |"What are we going to do today, Borg?"
Owner of Elecraft K2 #2172      |"Same thing we always do, Pinkutus:
                                 |  Try to assimilate the world!"
#include <disclaimer/favourite> |              -Pinkutus & the Borg

[Index of Archives]     [Gimp Developers]     [Gimp Users]     [Yosemite News]     [Epson Inkjet Printers]     [Scanners]     [Gimp's Home]     [Steve's Art]

&hbsp; Powered by Linux