help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Closures - do you understand them well?


From: tomas
Subject: Re: Closures - do you understand them well?
Date: Fri, 9 Dec 2022 20:50:14 +0100

On Fri, Dec 09, 2022 at 08:40:50PM +0100, Michael Heerdegen wrote:
> <tomas@tuxteam.de> writes:
> 
> > So I learnt something from the riddle, after all [1].
> 
> Cool that there was something to learn for some people.

It was enjoyable, yes :)

> The second part of the exercise is now of course (this goes to
> everyone): how to "fix" the code so that what some people expected is
> the end result?...:
> 
>  Write an expression that returns a list of 100 functions accepting zero
>  arguments.  `funcall'ing the Nth function must return N.  Use a `while'
>  loop or whatever you like but please not `dolist' or any tool that
>  already handles this "problem" specifically.

Hm. I imagine in the middle of my code "fred's function factory", like
so:

  (defun fred-s-function-factory (n)
    ...)

(i won't tell more now ;)

> > [1] The most general rule seems still to be: "all generalisations
> >    suck"
> 
> I think this is the first instance of Russell's paradox I have ever met
> in real life.

Then I would like you to meet my barber...

Cheers
-- 
t

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]