Hacker News new | past | comments | ask | show | jobs | submit login

I wouldn't say it's the opposite. It sounds the opposite from the title, but this actually returns Wikipedia content. The other one fetches a link to a site.



I just meant opposite in the most trivial sense:

  (reverse '("Wikipedia" "over" "DNS"))
  => ("DNS" "over" "Wikipedia")


finally my lisp class has aided me in a real-life scenario


I never had a lisp class, so I'm sitting here wondering why there is one single quote.


Out of curiosity, did the sibling replies to your comment (all of which are accurate!) answer your question, in the sense that you now understand?


I'm glad my functional programming classes used Haskell instead:

  Hugs> reverse ["Wikipedia", "over", "DNS"]
  ["DNS","over","Wikipedia"]


That's a reader macro to make it quoted.

What that means is 'don't try to evaluate this as a function call'.

Basically it's a data list.


Otherwise the single-unquoted ( would be treated as a function call.


to prevent evaluation.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: