C is weakly typed. Lisp is strongly typed.

30 Jul

Not düşeyim bir kenara, epey güldürmüştü beni vakti zamanında.

C is weakly typed.
LISP is strongly typed.

diye konuya girmiş olan Pascal Bourguignon şöyle devam etmiş:

“In C:

% cat b.c
int main(int argc,char** argv){

% make -k b
make: `b' is up to date.
% ./b xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
% ./b xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx yyyyyyyyyyyyyyyyyyyy
% ./b
Segmentation fault

On the other hand, in LISP:

[203]> (+ "hello world" 42)

*** - +: "hello world" is not a number
The following restarts are available:
USE-VALUE      :R1      You may input a value to be used instead.
ABORT          :R2      ABORT
Break 1 [204]> :q
[205]> (compile nil (lambda () (+ "Hello" 42)))
Arithmetic operand "Hello" must evaluate to a number, not "Hello"
Run time error expected: +: "Hello" is not a number

# ;
2 ;

Leave a comment

Posted by on July 30, 2006 in General, Lisp, Programlama


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: