Live data from Hacker News

Ninety-Nine Lisp Problems

ic.unicamp.br

1–10 of 11 posts

Re: Ninety-Nine Lisp Problems

#4
I looked at the first solution and my reaction is something along the lines of "what????".

Why not just something simple like.. (defun foo(thing) (list (nth (1- (length thing)) thing))

Same applies for problem 2.

Re: Ninety-Nine Lisp Problems

#5
post #4

I looked at the first solution and my reaction is something along the lines of "what????". Why not just something simple like.. (defun foo(thing) (list (nth (1- (length thing)) thing)) Same applies for problem 2.

And for number #5 you don't even need to write a function. Why not just use reverse? And notice his indentation and closing of parens is all wrong (i.e. not Lisp style). He's writing Lisp code thinking in a another language[1].

It's still a good exercise to go through them all as a Lisp newb like myself when I'm bored or need a break.

[1] Programming language, not Portuguese. :)

Re: Ninety-Nine Lisp Problems

#6
post #4

I looked at the first solution and my reaction is something along the lines of "what????". Why not just something simple like.. (defun foo(thing) (list (nth (1- (length thing)) thing)) Same applies for problem 2.

Or even (defun last(thing) (car (reverse thing)))

Re: Ninety-Nine Lisp Problems

#7
post #5
post #4

I looked at the first solution and my reaction is something along the lines of "what????". Why not just something simple like.. (defun foo(thing) (list (nth (1- (length thing)) thing)) Same applies for problem 2.

And for number #5 you don't even need to write a function. Why not just use reverse? And notice his indentation and closing of parens is all wrong (i.e. not Lisp style). He's writing Lisp code thinking in a another language[1]. It's still a good exercise to go through them all as a Lisp newb like myself when I'm bored or need a break. [1] Programming language, not Portuguese. :)

Well using reverse sort of misses the point. You are supposed to implement reverse.

Re: Ninety-Nine Lisp Problems

#8
post #5

Earlier quoted context omitted.

And for number #5 you don't even need to write a function. Why not just use reverse? And notice his indentation and closing of parens is all wrong (i.e. not Lisp style). He's writing Lisp code thinking in a another language[1]. It's still a good exercise to go through them all as a Lisp newb like myself when I'm bored or need a break. [1] Programming language, not Portuguese. :)

Well using reverse sort of misses the point. You are supposed to implement reverse.

Ah, well that does make it a bit more interesting. :)

Re: Ninety-Nine Lisp Problems

#10
post #5

Earlier quoted context omitted.

And for number #5 you don't even need to write a function. Why not just use reverse? And notice his indentation and closing of parens is all wrong (i.e. not Lisp style). He's writing Lisp code thinking in a another language[1]. It's still a good exercise to go through them all as a Lisp newb like myself when I'm bored or need a break. [1] Programming language, not Portuguese. :)

Well using reverse sort of misses the point. You are supposed to implement reverse.

I just find it a bit interesting that you are supposed to implement things that are given. That sort of defeats the purpose of doing one for a specific language.
Post reply on HN