From: ···········@gmail.com
Subject: Static, dynamic and Lisp types.
Date: 
Message-ID: <1190817402.383812.164070@50g2000hsm.googlegroups.com>
  You don't like declarations like in C:  int a,b,c

  I think that Lisp, in order to get a good compiler, declare the
types of the
 function arguments by changing the name of the function, so that for
example
in Python you have:


   a[3]           and this is for array, list, hash (dictionary), ...

  in Lisp you use a different name for each type.

 Another example is =,

 In python "ab" = "cd", in Lisp  String-equal, ...


  Do there is a name for a language like this, that is, creating a new
name for the
 same concept with different arguments?

From: ···········@gmail.com
Subject: Re: Static, dynamic and Lisp types.
Date: 
Message-ID: <1190818015.868585.212460@50g2000hsm.googlegroups.com>
On 26 Wrz, 16:36, ···········@gmail.com wrote:
>   You don't like declarations like in C:  int a,b,c
>
>   I think that Lisp, in order to get a good compiler, declare the
> types of the
>  function arguments by changing the name of the function, so that for
> example
> in Python you have:
>
>    a[3]           and this is for array, list, hash (dictionary), ...
>
>   in Lisp you use a different name for each type.
>
>  Another example is =,
>
>  In python "ab" = "cd", in Lisp  String-equal, ...
>
>   Do there is a name for a language like this, that is, creating a new
> name for the
>  same concept with different arguments?

Non OO.

Almost all CL functions are functions, not methods. Too old language,
backward compatibility and such...

(ok, there are some functions which are difficult to express as
(polymorphic) methods, especially &rest ones, +, - etc. But coerce,
equal, aref?...)

P.S You can use equal (and equalp) to compare strings. String-equal
exists just for performance.

P.Z.
From: Pillsy
Subject: Re: Static, dynamic and Lisp types.
Date: 
Message-ID: <1190827187.809766.39080@g4g2000hsf.googlegroups.com>
On Sep 26, 10:46 am, ···········@gmail.com wrote:
[...]
> P.S You can use equal (and equalp) to compare strings. String-equal
> exists just for performance.

Not just performance. It's also useful for comparing symbol names and
strings:

(equalp "foo" 'foo) => NIL

(string-equal "foo" 'foo) => T

Cheers,
Pillsy
From: Alberto Riva
Subject: Re: Static, dynamic and Lisp types.
Date: 
Message-ID: <fde92d$gc3a$1@usenet.osg.ufl.edu>
Pillsy wrote:
> On Sep 26, 10:46 am, ···········@gmail.com wrote:
> [...]
>> P.S You can use equal (and equalp) to compare strings. String-equal
>> exists just for performance.
> 
> Not just performance. It's also useful for comparing symbol names and
> strings:
> 
> (equalp "foo" 'foo) => NIL
> 
> (string-equal "foo" 'foo) => T

And also for case-insensitive comparison:

(string-equal "foo" "FOO") => T

And then of course there's STRING= for "true" string comparison:

(string= "foo" "foo") => T

(string= "foo" "FOO") => NIL


Alberto
From: Kent M Pitman
Subject: Re: Static, dynamic and Lisp types.
Date: 
Message-ID: <ufy11aylf.fsf@nhplace.com>
···········@gmail.com writes:

>   You don't like declarations like in C:  int a,b,c

Lisp allows these declarations, but not for the purpose of changing
dispatch behavior, so they are optional.  They are used by the
compiler to make certain things more efficient if you supply them (at
the cost of generality in some cases, depending on the types you
choose), but you're allowed to omit them.

 (defun f (a b)
   (+ a b))

 (defun ff (a b)
   (declare (fixnum a b c))
   (the fixnum (+ a b)))

The difference between f and ff is that ff may operate faster, but ff
may do the wrong thing with large integers, since you're promising
(the compiler might or might not check, but it is allowed to believe
you even without proof) that the inputs and results will be of a
certain size... a promise you can omit to get general behavior.

> I think that Lisp, in order to get a good compiler, declare the
> types of the function arguments by changing the name of the function,
> so that for example in Python you have:
> 
>    a[3]           and this is for array, list, hash (dictionary), ...
> 
>   in Lisp you use a different name for each type.

Largely this is an accident of history, although it does allow for
more efficient compilation in the absence of type declarations because
the compiler can do less type dispatch at runtime.

>  Another example is =,
> 
>  In python "ab" = "cd", in Lisp  String-equal, ...
> 
> 
> Do there is a name for a language like this, that is, creating a new
> name for the same concept with different arguments?

In Lisp, you can write "generic functions" that give the same function
name different implementations depending on the args.

However, = is a poor example of something to do this with.
http://www.nhplace.com/kent/PS/EQUAL.html
From: ···········@gmail.com
Subject: Re: Static, dynamic and Lisp types.
Date: 
Message-ID: <1190896516.302173.95450@r29g2000hsg.googlegroups.com>
On 26 sep, 23:47, Kent M Pitman <······@nhplace.com> wrote:
> ···········@gmail.com writes:
> >   You don't like declarations like in C:  int a,b,c
>
> Lisp allows these declarations, but not for the purpose of changing
> dispatch behavior, so they are optional.  They are used by the
> compiler to make certain things more efficient if you supply them (at
> the cost of generality in some cases, depending on the types you
> choose), but you're allowed to omit them.
>
>  (defun f (a b)
>    (+ a b))
>
>  (defun ff (a b)
>    (declare (fixnum a b c))
>    (the fixnum (+ a b)))
>
> The difference between f and ff is that ff may operate faster, but ff
> may do the wrong thing with large integers, since you're promising
> (the compiler might or might not check, but it is allowed to believe
> you even without proof) that the inputs and results will be of a
> certain size... a promise you can omit to get general behavior.
>
> > I think that Lisp, in order to get a good compiler, declare the
> > types of the function arguments by changing the name of the function,
> > so that for example in Python you have:
>
> >    a[3]           and this is for array, list, hash (dictionary), ...
>
> >   in Lisp you use a different name for each type.
>
> Largely this is an accident of history, although it does allow for
> more efficient compilation in the absence of type declarations because
> the compiler can do less type dispatch at runtime.
>
> >  Another example is =,
>
> >  In python "ab" = "cd", in Lisp  String-equal, ...
>
> > Do there is a name for a language like this, that is, creating a new
> > name for the same concept with different arguments?
>
> In Lisp, you can write "generic functions" that give the same function
> name different implementations depending on the args.
>
> However, = is a poor example of something to do this with.http://www.nhplace.com/kent/PS/EQUAL.html

Your paper http://www.nhplace.com/kent/PS/EQUAL.html is very
interesting. But i think the speed of compiled Lisp
require not to use generic methods in common expressions.

 You could define a generic function [  and also the quick functions
a[, h[, ... and use the former for
code that where speed in not critical and the latter for optimized
code.  Also the use of additional information via a intentional type
is a very good idea. Thanks for this link.
From: Alex Mizrahi
Subject: Re: Static, dynamic and Lisp types.
Date: 
Message-ID: <46fa97ed$0$90273$14726298@news.sunsite.dk>
(message (Hello ············@gmail.com)
(you :wrote  :on '(Wed, 26 Sep 2007 14:36:42 -0000))
(

 a>   Do there is a name for a language like this, that is, creating a new
 a> name for the
 a>  same concept with different arguments?

Non OO.

Lisp allows functions to be both efficient by being specialized to some type 
and have generic name.
those are generic functions, of course.

there's often dispatching overhead associated with them, so they might be 
not that efficient.
BUT in theory it should be possible for implementation to know argument 
types via type inference (or whatever) and to inline a specific method call 
(or method itself!) into caller.

however, i don't know if any of implementations actually implement such 
optimizations. also, methods of generic function can be changed in runtime, 
and so if method was inlined that function should be recompiled, or 
something like that..

so i think there's a solution to make it absolutely effective, if somebody 
really wants to

)
(With-best-regards '(Alex Mizrahi) :aka 'killer_storm)
"Hanging In The Balance Of Deceit And Blasphemy") 
From: Jon Harrop
Subject: Re: Static, dynamic and Lisp types.
Date: 
Message-ID: <13g0150lbfi3pa7@corp.supernews.com>
···········@gmail.com wrote:
>   Do there is a name for a language like this, that is, creating a new
> name for the
>  same concept with different arguments?

An excellent point. This problem was already solved by Standard ML, OCaml,
F# and Haskell.

-- 
Dr Jon D Harrop, Flying Frog Consultancy
http://www.ffconsultancy.com/products/?u