all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Lars Magne Ingebrigtsen <lmi@gnus.org>
Subject: Re: Differences between Elisp and Lisp
Date: Thu, 01 May 2003 05:22:08 GMT	[thread overview]
Message-ID: <m3wuhb9r7w.fsf@quimbies.gnus.org> (raw)
In-Reply-To: <5ld6j3io7i.fsf@rum.cs.yale.edu> (Stefan Monnier's message of "30 Apr 2003 19:02:09 -0400")

"Stefan Monnier" <monnier+gnu.emacs.help/news/@flint.cs.yale.edu> writes:

>>>>>> "Lars" == Lars Magne Ingebrigtsen <lmi@gnus.org> writes:
>> and dispatching functions based on type would be nice.
>
> Never heard that one.  What exactly would you like to see ?

The Common Lisp `defmethod' thingie.  Which is a part of CLOS, I
guess, but wouldn't have to be.  But one would need a type system.

(defmethod do-stuff ((arg string))
  ... do stuff with a string)

(defmethod do-stuff ((arg number))
  ... do stuff with a number)

And then one could just say (do-stuff whatever) here and there.

This is really just syntactical sugar on the "pattern"

(defun do-stuff (arg)
  (cond ((stringp arg)
         ... do stuff with a string)
        ((numberp arg)
         ... do stuff with a number)))

but it's really useful.  Especially when you're able to define your
own classes.  Er, types.

Perhaps eieio already provides this?
  
-- 
(domestic pets only, the antidote for overdose, milk.)
   larsi@gnus.org * Lars Magne Ingebrigtsen

  reply	other threads:[~2003-05-01  5:22 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.5343.1051607007.21513.help-gnu-emacs@gnu.org>
2003-04-29 10:22 ` Differences between Elisp and Lisp Friedrich Dominicus
2003-04-29 10:27 ` Lars Magne Ingebrigtsen
2003-04-29 10:35   ` David Kastrup
2003-04-29 11:03   ` Oliver Scholz
2003-04-29 12:23     ` Phillip Lord
2003-04-29 14:17       ` Thomas Link
2003-04-29 15:43         ` Kent M Pitman
2003-04-29 15:56           ` Phillip Lord
2003-04-29 16:44             ` Kent M Pitman
2003-04-29 17:16               ` Phillip Lord
2003-04-29 18:41                 ` Kai Großjohann
2003-04-30 12:39                   ` Phillip Lord
2003-04-30 13:12                     ` Kai Großjohann
2003-04-30 18:07                     ` Kevin Rodgers
2003-04-29 18:59             ` Oliver Scholz
2003-04-30 12:43               ` Phillip Lord
2003-04-29 17:01       ` Kai Großjohann
2003-04-30 23:02   ` Stefan Monnier
2003-05-01  5:22     ` Lars Magne Ingebrigtsen [this message]
2003-05-01  5:41       ` Friedrich Dominicus
2003-05-01  5:54         ` Lars Magne Ingebrigtsen
2003-05-01  6:37           ` [OT] " Friedrich Dominicus
     [not found] ` <yoijznm9y5yr.fsf@bilbo.dd.chalmers.se>
2003-04-29 13:45   ` Kent M Pitman
2003-04-29 15:23     ` Nicolas Neuss
2003-04-29 15:28       ` Nicolas Neuss
2003-04-29 14:23   ` Marco Antoniotti
2003-04-29 14:29     ` Phillip Lord
2003-04-29 19:06       ` Oliver Scholz
2003-04-29 16:51 ` Kaz Kylheku
2003-04-29  8:57 Daniel R. Anderson

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=m3wuhb9r7w.fsf@quimbies.gnus.org \
    --to=lmi@gnus.org \
    /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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.