caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Thomas Fischbacher <Thomas.Fischbacher@Physik.Uni-Muenchen.DE>
To: yoann padioleau <padator@wanadoo.fr>
Cc: Jonathan Roewen <jonathan.roewen@gmail.com>, caml-list@yquem.inria.fr
Subject: Re: [Caml-list] lisp to ocaml
Date: Sun, 18 Sep 2005 16:37:56 +0200 (CEST)	[thread overview]
Message-ID: <Pine.LNX.4.61.0509181628440.1141@eiger.cip.physik.uni-muenchen.de> (raw)
In-Reply-To: <FDFBAEE6-B469-4872-998A-D96E43694EDC@wanadoo.fr>


On Sun, 18 Sep 2005, yoann padioleau wrote:

> You can also in some scheme (such as plt scheme) use other symbols than
> parenthesis such as '[' ']'.
> It reduces the number of () and makes some code looks better.
> 
> for instance
> 
> (defun factorial (n)
> (cond [(= n 0) 1]
> [(> n 0)  (* n (fact (- n 1)))]
> )) 

This gets somewhat off-topic now, but just for completeness, let me 
mention that one can easily modify the ANSI CL reader in such a way 
that some characters are handled by custom code, and just make [] or even 
{} behave as if they also were (). This works for every ANSI-compliant CL.
(Not that I would recommend this in any way.)

I see the attempt to learn ocaml as a first step to understand Lisp 
with somewhat mixed feelings. (Even though right now, I teach it for more 
or less just that reason...)

Certainly, it is very useful in many situations to know some OCaml, but if
one just wants to learn Lisp, but is too spoilt by some syntax-rich 
languages that the uniformity of Lisp's parens turns out to be a problem,
it might or might not be more appropriate to instead start with a LISP 
with a bit more syntactic sugar on top of it, which can use 
reader-dispatch to parse blocks of semicolon-delimited infix statements...

-- 
regards,               tf@cip.physik.uni-muenchen.de              (o_
 Thomas Fischbacher -  http://www.cip.physik.uni-muenchen.de/~tf  //\
(lambda (n) ((lambda (p q r) (p p q r)) (lambda (g x y)           V_/_
(if (= x 0) y (g g (- x 1) (* x y)))) n 1))                  (Debian GNU)


  reply	other threads:[~2005-09-18 14:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-18  1:08 Jonathan Roewen
2005-09-18  2:56 ` Jon Harrop
2005-09-18 14:06 ` Thomas Fischbacher
2005-09-18 14:17   ` yoann padioleau
2005-09-18 14:37     ` Thomas Fischbacher [this message]
2005-09-18 15:44   ` Jon Harrop
2005-09-18 16:08     ` Thomas Fischbacher
2005-09-18 17:10       ` brogoff
2005-09-19 13:08 ` Christoph Bauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.61.0509181628440.1141@eiger.cip.physik.uni-muenchen.de \
    --to=thomas.fischbacher@physik.uni-muenchen.de \
    --cc=caml-list@yquem.inria.fr \
    --cc=jonathan.roewen@gmail.com \
    --cc=padator@wanadoo.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).