[Gllug] Logo as a first language

Richard Jones rich at annexia.org
Wed Mar 9 15:06:54 UTC 2005


On Wed, Mar 09, 2005 at 01:59:37PM +0000, Nix wrote:
> On Mon, 7 Mar 2005, Richard Jones announced authoritatively:
> > Luckily (OCa-)ML is a practical functional language, and actually lets
> > you do all the useful stuff like IO and mutable variables without
> > complaining ...
> 
> Via monads, I presume? :)

Good god man, no!

It's a practical language.  If you mark a variable as mutable or a
reference (which is a special case of mutable), then you can update
it.  It's just like C or C++, except in reverse.  In C/C++ you have to
explicitly mark variables you want to remain constant (via "const").
In OCaml you mark variables you want to update.  As a rule of thumb,
only about 1 in 50 of my variable declarations are marked as mutable,
so you get the compiler efficiency of immutable/pure languages,
without having to have your hands tied behind your back when you
really actually just want to write something imperatively.

For I/O, you just use printf, scanf, ... and so on.

Rich.

-- 
Richard Jones, CTO Merjis Ltd.
Merjis - web marketing and technology - http://merjis.com
Team Notepad - intranets and extranets for business - http://team-notepad.com
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list