Re: Request for review

2021-05-14 Thread Arnaud Bailly
-- 
Arnaud Bailly - @dr_c0d3

On Fri, May 14, 2021 at 10:27 PM Vasilij Schneidermann  wrote:
>
>
> I'd generally recommend studying Riastradh's style guide [1]_.
Thanks for the pointer!
>
> - Why bind variables with let, then immediately set! them? For
>   side-effectful values I'd just use let* with the corresponding
>   expression.
Indeed!
> - Consider doing some basic encapsulation by writing
>   constructor/accessor procedures, that makes swapping out the
>   implementation a lot easier. SICP has a bunch of things to say on the
>   topic.
I have read it quite a while ago :) But I guess it's time for a second look.

Thanks a lot for your feedback!

Arnaud



Re: Request for review

2021-05-14 Thread Vasilij Schneidermann
Hello Arnaud,

> I have started a small project whose purpose is to simulate Darwin's
> theory and I would really appreciate some code review from more
> experienced scheme developers, esp. when it comes to structuring,
> idiomatic code patterns, egg definitions...

I'd generally recommend studying Riastradh's style guide [1]_. That
aside:

- Stick closing parentheses together.
- No need to use begin in let and let*, it's doing an implicit begin.
- Why bind variables with let, then immediately set! them? For
  side-effectful values I'd just use let* with the corresponding
  expression.
- print takes several arguments, so no need to string-append them.
- Consider doing some basic encapsulation by writing
  constructor/accessor procedures, that makes swapping out the
  implementation a lot easier. SICP has a bunch of things to say on the
  topic.

[1]: https://mumble.net/~campbell/scheme/style.txt


signature.asc
Description: PGP signature