Bill Atkins wrote: > "Javier" <javu...@gmail.com> writes:
>> And another question too: how to redefine generic functions in a living >> environment to change, for example, the number of arguments, supposing >> that you have already defined methods to that generic function?
> (fmakunbound 'generic-function-name)
A simple defgeneric will actually also do. However, when you change the lambda list, you will also lose the methods defined on the generic function.
> >> And another question too: how to redefine generic functions in a living > >> environment to change, for example, the number of arguments, supposing > >> that you have already defined methods to that generic function? > > (fmakunbound 'generic-function-name)
> A simple defgeneric will actually also do. However, when you change > the lambda list, you will also lose the methods defined on the generic > function.
This will signal an error if the methods with incongruent lambda lists were defined with DEFMETHOD rather than by the previous DEFGENERIC.
>>> And another question too: how to redefine generic functions in a living >>> environment to change, for example, the number of arguments, supposing >>> that you have already defined methods to that generic function?
>> (fmakunbound 'generic-function-name)
> A simple defgeneric will actually also do.
No it won't, except in the special case of all methods on the generic function having been defined using :METHOD in a previous DEFGENERIC.
: If a defgeneric form is evaluated and some methods for that generic : function have lambda lists that are not congruent with that given in : the defgeneric form, an error is signaled.
Adam <nos...@example.com> writes: > Well, :Slime 2005-04-27 is there in my usual Emacs setup - I just don't > actively or consciously use it. C-h m shows reports no mode specifics. C-h > a slime lists very many slime commands. What Swank is I have no idea.
> GP lisper wrote: >> Then you've never used slime, it's pretty self-evident. >> <goes back to ignoring trolls>
> Your logic doesn't quite follow.
> Slime is a superior interaction mode, yet it doesn't show up as a mode. > How Slime helps with "incremental programming" thus remains a mystery.
My over 30 years with Lisp have been one continuous Aha insight. Each new function a finely tuned concept. And macros -- Ah sweet mystery of abstraction! - capture the infinitely more sensuous discovery of entire new ways of thought! Even debugging often leads me to deeper understanding; facets reflect facets reflect facets -- a recursive maze of perfectly ground mirrors that when set aright prismatically undress the deep nature of the problem domain, and of Lisp itself, before the mind's eye.
JShra...@gmail.com writes: > My over 30 years with Lisp have been one continuous Aha insight. Each > new function a finely tuned concept. And macros -- Ah sweet mystery of > abstraction! - capture the infinitely more sensuous discovery of > entire new ways of thought! Even debugging often leads me to deeper > understanding; facets reflect facets reflect facets -- a recursive maze > of perfectly ground mirrors that when set aright prismatically undress > the deep nature of the problem domain, and of Lisp itself, before the > mind's eye.
Nicely put. Who's writing the next book about/on/for Lisp? I vote for this paragraph to be part of the Preface or some chapter heading.
Zach Beane wrote: > What are some of the things that triggered your own Aha! moments? What > sort of stuff delighted you when you discovered it?
Well, I am only a newbie, so these are beginner aha!s on the lispy foothills, but for the record:
(i) Doing symbolic differentiation and hence Newton's method in SICP.
(ii) Realising that I understood call/cc well enough to write python-style generator functions was pretty cool. When I realized that I could use macros to replace all that code with nice defgenerator and yield statements I think I might have had one of those moments. Oooh, power!
(iii) The recent s-expressions/sweet-expressions spat was one, because I realised that I actually *prefer*
(defun factorial (n) (if (<= n 1) 1 (* n (factorial (- n 1)))))
to
defun factorial (n) if (n <= 1) 1 n * factorial(n - 1)
A month ago it would have been the other way round.
(iv) A conversation in the pub the other day with a Ruby-speaking friend:
I speak Python and he speaks Ruby. After a long debate we'd pretty much agreed that Python and Ruby are just different syntaxes for the same things, and so I got on to evangelising Scheme, and he already knew what call/cc did, because Ruby has it, and we wondered if maybe that makes it better than Python for web stuff? And of course a bit of a web search reveals many brave efforts to add call/cc to Python.
And so now I have independent evidence for the often repeated assertion that the widely-used languages are converging back to lisp. c->c++->java->python->ruby->........->lisp?
Juho Snellman wrote: > Pascal Costanza <p...@p-cos.net> wrote: >> Bill Atkins wrote: >>> "Javier" <javu...@gmail.com> writes:
>>>> And another question too: how to redefine generic functions in a living >>>> environment to change, for example, the number of arguments, supposing >>>> that you have already defined methods to that generic function? >>> (fmakunbound 'generic-function-name) >> A simple defgeneric will actually also do.
> No it won't, except in the special case of all methods on the generic > function having been defined using :METHOD in a previous DEFGENERIC.
> : If a defgeneric form is evaluated and some methods for that generic > : function have lambda lists that are not congruent with that given in > : the defgeneric form, an error is signaled.
Ah right. I just confused this with the fact that in most implementations, this is a correctable error.
Zach Beane wrote: > What are some of the things that triggered your own Aha! moments? What > sort of stuff delighted you when you discovered it? What advice would > you give people who want to have more Aha! moments?
My initial encounter with lisp was through a capital/article in hofstadters metamagical themas, after which i promptly started writing an email to a friend of mine, in which i tried to cramp as many parenthesis as possible. I didn't program at the time and was mainly fascinated with those parens which neatly closed off one meaning from the other.
A few years back i started dabbling in a few sub-par programming languages, searching for one that stuck. I came across some emacs code. I tried to make sense out of it, but to no avail. It was the first time that i was absolutely sure that i could finally scratch a programming language off my to learn list. Ridiculous language.
Then, a year and a few months ago, i stumbled upon lisp again, and i got an aha moment, which was at the same time an aha erlebnis. Those sweet parens soothed the mind and burned it at the same time. No or { or = or . or -> or * or order of evaluation that snoops the mind from processor power and focus. I'm a simple person,with simple needs. I like my programming language straight and smooth, like Beyonce likes her hair. Later of course you learn about all these wicked toys like macros and clos. It blows your mind and all, but underneath it all it's that kind of weird satisfying calmness that comes over me when i securely lock up yet another statement in a closing paren. For my atheist mind it's the closest i ever came to what i guess should be a mystic experience. (hmm... one gets into some assumption problems in that last sentence.)
> Then, a year and a few months ago, i stumbled upon lisp again, and i > got an aha moment, which was at the same time an aha erlebnis. Those > sweet parens soothed the mind and burned it at the same time. No or { > or = or . or -> or * or order of evaluation that snoops the mind from > processor power and focus. I'm a simple person,with simple needs. I > like my programming language straight and smooth, like Beyonce likes > her hair. Later of course you learn about all these wicked toys like > macros and clos. It blows your mind and all, but underneath it all it's > that kind of weird satisfying calmness that comes over me when i > securely lock up yet another statement in a closing paren. For my > atheist mind it's the closest i ever came to what i guess should be a > mystic experience. (hmm... one gets into some assumption problems in > that last sentence.)
Pour moi, la grande question n'a jamais été: «Qui suis-je? Où vais-je?» comme l'a formulé si adroitement notre ami Pascal, mais plutôt: «Comment vais-je m'en tirer?» -- Jean Yanne
Zach Beane <x...@xach.com> writes: > Here are a few things that triggered major Aha! moments for me, in no > particular order.
[...]
> What are some of the things that triggered your own Aha! moments? What > sort of stuff delighted you when you discovered it? What advice would > you give people who want to have more Aha! moments?
In particular, realising that you could write a handful of primitives and then use regular CL macros to bootstrap the rest of the language off those was a big "Aha!" for me.