Re: meaning of a dialet or implementation of a programming language
From: John Thingstad (john.thingstad_at_chello.no)
Date: 09/24/04
- Next message: Matthew Danish: "Re: meaning of a dialet or implementation of a programming language"
- Previous message: John Thingstad: "Re: meaning of a dialet or implementation of a programming language"
- In reply to: John Thingstad: "Re: meaning of a dialet or implementation of a programming language"
- Next in thread: Matthew Danish: "Re: meaning of a dialet or implementation of a programming language"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 24 Sep 2004 21:46:04 +0200
On Fri, 24 Sep 2004 21:10:51 +0200, John Thingstad
<john.thingstad@chello.no> wrote:
> On 24 Sep 2004 13:16:31 -0400, Matthew Danish <mrd+nospam@cmu.edu> wrote:
>
>> "John Thingstad" <john.thingstad@chello.no> writes:
>>> On 24 Sep 2004 09:16:46 -0700, Jaap Weel <mylastname@caltech.edu>
>>> wrote:
>>> > Type-safe: in Lisp (+ 3 "a") just barfs, because it does not make
>>> > sense within the type system. Type safety can also be implemented in
>>> a
>>> > static type system (e.g. ML). In C, a type-unsafe language, 3 + "a"
>>> > returns a value of which the representation in hardware is obtained
>>> by
>>> > pretending the representation of the memory location of the string
>>> "3"
>>> > were the representation of an integer and adding it to 3.
>>> NO! That would be PERL. C does not do automatic type conversion.
>>
>> It's not about automatic type conversion. It has to do with strings
>> being pointers.
>>
>> $ cat test.c
>> #include<stdio.h>
>> int main(void) {
>> char *str = "foobar";
>> printf("%s\n", str + 3);
>> return 0;
>> }
>> $ gcc -Wall test.c
>> $ ./a.out
>> bar
>> $
>>
>
> Yes, but most peaple today use ANSI C or C++.
> You wouldn't talk about Lisp as of 1980 would you.
>
try gcc -ANSI -Pedantic -Wall test.c
-- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
- Next message: Matthew Danish: "Re: meaning of a dialet or implementation of a programming language"
- Previous message: John Thingstad: "Re: meaning of a dialet or implementation of a programming language"
- In reply to: John Thingstad: "Re: meaning of a dialet or implementation of a programming language"
- Next in thread: Matthew Danish: "Re: meaning of a dialet or implementation of a programming language"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|