caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Vitaly Lugovsky <vsl@ontil.ihep.su>
To: David Frese <dfrese@dfrese.de>
Cc: Caml-list <caml-list@inria.fr>
Subject: Re: [Caml-list] Q: safe language
Date: Fri, 30 Aug 2002 19:38:21 +0400 (MSD)	[thread overview]
Message-ID: <Pine.LNX.4.33.0208301933400.4099-100000@ontil.ihep.su> (raw)
In-Reply-To: <1030719022.1831.32.camel@pc-6>

On 30 Aug 2002, David Frese wrote:

> > > >  (cadr '(1))
> > > 
> > > This shows that Lisp is safe, because it results in an error, and does
> > > not return some value from out of nowhere (or does it).
> > 
> >  No. In this place program may be expecting some structure, which can 
> > contain NIL. There is no other way in lisp to define structures - so, any
> > code accepting lists will accept any alien structure. Is is type safety? 
> 
> If you are refering to the fact, that the expression above returns NIL,
> then yes, this is no type-safety, and a very bad thing - I did not know
> that.

 It depends on the Lisp implementation. But, you can find a lot of 
"unsafe" examples with correct behavior: e.g. 3-d vector passed as 2-d 
vector, and lisp function working with structures using only cars and 
cdrs will not fail with it.

> > No way! Dynamically typed languages can't be safe.
> 
> I don't think this is a problem of dynamic or static typing, but a mad
> behaviour of Lisp.

 With polymorphism and dymanic typing the programm may not fail at the 
point where wrong type was passed - and this is "unsafe" behaviour (this 
is where I have an ugly headache with Java).
Statically typed language will not allow potentially unsafe function 
calls. 


-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


  reply	other threads:[~2002-08-30 15:56 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-30  1:36 SooHyoung Oh
2002-08-30  8:41 ` sebastien FURIC
2002-08-30 12:44 ` Vitaly Lugovsky
2002-08-30 13:05   ` David Frese
2002-08-30 13:46     ` Oleg
2002-08-30 16:09       ` Yutaka OIWA
2002-08-30 13:49     ` Vitaly Lugovsky
2002-08-30 14:04       ` J Farrand
2002-08-30 14:26         ` Vitaly Lugovsky
2002-08-30 14:48           ` Nicolas Cannasse
2002-08-30 15:31             ` Vitaly Lugovsky
2002-08-30 14:55           ` Mike Lin
2002-08-30 14:58             ` Eric Newhuis
2002-08-30 16:03           ` Yutaka OIWA
2002-08-30 21:44           ` Oliver Bandel
2002-09-01  8:07         ` John Max Skaller
2002-08-30 14:50       ` David Frese
2002-08-30 15:38         ` Vitaly Lugovsky [this message]
2002-08-30 15:28     ` didier plaindoux
2002-08-30 14:41 ` Florian Hars
2002-08-30 14:42 ` Nicolas Cannasse

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.33.0208301933400.4099-100000@ontil.ihep.su \
    --to=vsl@ontil.ihep.su \
    --cc=caml-list@inria.fr \
    --cc=dfrese@dfrese.de \
    /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).