From: mk
Subject: Aliases
Date: 
Message-ID: <1126000590.727338.152730@g44g2000cwa.googlegroups.com>
SXMgdGhlcmUgYSB3YXkgdG8gY3JlYXRlIHNvbWV0aGluZyBsaWtlIGFsaWFzIGluIGxpc3AuCkZv
ciBleGFtcGxlLCBJIHdhbnQgdG8gZG8gc29tZXRoaW5nIGxpa2U6CihhbGlhcyAnZGVmdW4gJ9C0
0LXRhNGD0L0pCihhbGlhcyAnbGV0ICfQu9C10YIpCmFuZCB0byB1c2UgbXkgYWxpYXNlcyBmb3Ig
ZnVydGhlciBwcm9ncmFtbWluZy4gRWcuCijQtNC10YTRg9C9INC80L7RmNCwLdGE0YPQvdC60YbQ
uNGY0LAgKNC40LrRgSkKICAo0LvQtdGCICjRhiDQuNC60YEpCiAgLi4uLgoKdGhlIGdvYWwgaXMg
dG8gdXNlIG15IG93biBsYW5ndWFnZSBmb3IgYW55dGhpbmcgaW4gbGlzcC4KClRoYW5rcwo=

From: Ulrich Hobelmann
Subject: Re: Aliases
Date: 
Message-ID: <3o5ckqF4abmbU2@individual.net>
mk wrote:
> Is there a way to create something like alias in lisp.

You could define either functions or macros.

> the goal is to use my own language for anything in lisp.

Use functions, or if you want your arguments to not be evaluated, macros.

-- 
My ideal for the future is to develop a filesystem remote interface
(a la Plan 9) and then have it implemented across the Internet as
the standard rather than HTML.  That would be ultimate cool.
	Ken Thompson
From: R. Mattes
Subject: Re: Aliases
Date: 
Message-ID: <pan.2005.09.06.13.54.55.857534@mh-freiburg.de>
On Tue, 06 Sep 2005 13:25:12 +0200, Ulrich Hobelmann wrote:

> mk wrote:
>> Is there a way to create something like alias in lisp.
> 
> You could define either functions or macros.
> 
>> the goal is to use my own language for anything in lisp.
> 
> Use functions, or if you want your arguments to not be evaluated, macros.

Why introduce the extra overhead?

  (setf (macro-function 'дефун) (macro-function 'defun))
  
or 

 (setf (symbol-function 'blub) (symbol-function 'format))  

NOTE: this won't work for things like 'let (which can
be neither macro nor function).

 Cheers Ralf Mattes
From: ··········@gmail.com
Subject: Re: Aliases
Date: 
Message-ID: <1126020614.842533.8540@g49g2000cwa.googlegroups.com>
(defmacro alias (name al)
 `(defmacro ,al (&rest rest)
    `(,',name ,@rest)))

should work.  It makes

 (alias defun дефун)

expand into

(defmacro дефун (&rest rest)
 (defun ,@rest))

Not only do you not need quotes, it also works for (let...)!
From: mk
Subject: Re: Aliases
Date: 
Message-ID: <1126023118.547335.298200@g49g2000cwa.googlegroups.com>
I new there is an easy way to do that in lisp ;)

Thanks
From: Nickolay Savchenko
Subject: Re: Aliases
Date: 
Message-ID: <87k6huw078.fsf@vatutin.emacs.no-ip.org>
··········@gmail.com writes:

> (defmacro alias (name al)
>  `(defmacro ,al (&rest rest)
>     `(,',name ,@rest)))
>
> should work.  It makes

There is a problem here: if you make an alias for a function in such
way, you cannot use it as argument for funcall, apply and others.

-- 
Best regards
Nickolay Savchenko
From: Thomas F. Burdick
Subject: Re: Aliases
Date: 
Message-ID: <xcv1x42m2ao.fsf@conquest.OCF.Berkeley.EDU>
"R. Mattes" <··@mh-freiburg.de> writes:

> On Tue, 06 Sep 2005 13:25:12 +0200, Ulrich Hobelmann wrote:
> 
> > mk wrote:
> >> Is there a way to create something like alias in lisp.
> > 
> > You could define either functions or macros.
> > 
> >> the goal is to use my own language for anything in lisp.
> > 
> > Use functions, or if you want your arguments to not be evaluated, macros.
> 
> Why introduce the extra overhead?

Because it's nice to do the right thing when the aliased
function/macro is redefined.  This is closer to right:

  (defmacro alias (alias name)
    (if (macro-function name)
        `(defmacro ,alias (&rest args)
           (cons ',name args))
        `(progn
           (defun ,alias (&rest args)
             (apply ',name args))
           (define-compiler-macro ,alias (&rest args)
             (cons ',name args)))))

-- 
           /|_     .-----------------------.                        
         ,'  .\  / | Free Mumia Abu-Jamal! |
     ,--'    _,'   | Abolish the racist    |
    /       /      | death penalty!        |
   (   -.  |       `-----------------------'
   |     ) |                               
  (`-.  '--.)                              
   `. )----'