For Programmers: Free Programming Magazines  


Home > Archive > Scheme > September 2004 > Re: Scheme for programmers book









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 Re: Scheme for programmers book
Michael Erdmann

2004-09-29, 5:00 am

Jens Axel Søgaard wrote:
> Michael Erdmann wrote:
>
>
>
> Breaking things up in manageable modules is the thing to do.
>
>
>
> A test suite that exercises all the code is the way to go.


This is a statement i can live with, extensive testing is requiered. But
my statement on top is, even more testing is required in the real
runtime environment.


>
> Allow a little side remark: Even in a statically typed language a
> test suite is needed. Suppose the function foo is changed from
> expecting a vector of any length to a expecting a vector of length
> two or more - how is the type checker supposed to catch that?


This is true, everthing which changes a data type during execution
can't be catched by the compiler. In Ada you will get a contrain
exception you can catch. What happens in scheme. I have the impression
that you get some unspecified exception with scheme.



> A small example from <http://okmij.org/ftp/Scheme/assert.txt>:
>
> (let ((n (begin (display "Enter a positive integer:")
> (newline) (read))))
> (assert (integer? n) (> n 0)
> report: "Domain error" n
> "You should've entered a positive value" #\!)
> (fact n))
>

This is what i was wondering why there is no support development by
contracts in scheme, since this asert check could be compiled in the
runtime environment controling if function is called at all?
>
>
> I don't think SoftScheme is ready-to-use in a production environment.
> If someone proves me wrong, I'll be deligthed.
>

Don't ask me about soft_sceme. It neither compiles with bigloo nor
chicken. I will have to spend mutch more time on this issue then
i have expected.

>
>
> Chicken among others produce executables, so that ought to be
> straight forward.

I guess so, is there any typical disribution format like rpm's,
but i guess it realy does not matter then.

>
>
>
> It's hard to give such guide lines. Read some various Scheme programs
> to get a feel of the style. To see some small snippets doing every-day
> stuff try looking at <http://shootout.alioth.debian.org/lang/chicken/>.
> Another source is <http://www.schemecookbook.org>.
>

The reason why i am askising is, that i am used from Ada 95 or C, that
there is a style guide. This also include constructs you should avoid
since they are error prone or to difficult to read with in a short
notice.

> My own experience is that my coding style has changed over the years.
> This ranges from personal idiosyncrasies to more important ones.
>
> Idiosyncracy: I hardly ever use IF anymore, I always use COND.
> Philosophical: I code first and worry about portability later.
> Experience: It took a quite while to learn to recognize the
> situations where macros can be big time savers.
>

As you write above, experience, so this for me in the moment a
low priority issue.


Sponsored Links







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

Copyright 2008 codecomments.com