Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
kbp
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
27 ms
·
211.
▲
by
kbp
9y ago
It has optional static typing: > sub f(Int $x) { $x + 1 } sub f (Int $x) { #`(Sub|140221097113944) ... } > sub g(Str $x) { f($x) } ===SORRY!=== Error while compiling: Calling f(Str) will never work with declared
212.
▲
by
kbp
9y ago
> the accepted pronunciation of various tech project names Resque (where the readme says in the first sentence that it is pronounced like 'rescue') always bugged me. Are there any English words where 'que' at the end
213.
▲
by
kbp
9y ago
> Music is no longer a social movement. Back in the day being a fan of the Clash went far beyond music you were joining a social/political movement, something you believed in. Katy Perry might sing a catchy tune but its all about he
214.
▲
by
kbp
9y ago
> 18 years ago. Perl and Python. Perl 18 years ago is pretty standard.
215.
▲
by
kbp
9y ago
> No one claimed Hickey invented first and rest, or even implied it. I think that saying "This is why Clojure has first instead of car and rest instead of cdr" is a very odd way of saying "this is why Clojure doesn't
216.
▲
by
kbp
9y ago
> We do have it, it is called "elt" in Lisp. In Common Lisp, ELT is generic over sequences, so it also works on arrays. CL also has a function actually called NTH which is specific to lists; NTH was also in Maclisp, Lisp Machin
217.
▲
by
kbp
9y ago
Oh, sorry, the linked story used to be different. I hadn't noticed it was changed.
218.
▲
by
kbp
9y ago
That is cool, but I was wondering if you had a citation for Steve Russell coining the names? I don't believe that's true.
219.
▲
by
kbp
9y ago
> The 90% case here is "second", "third", etc. In addition to first and rest, Lisp has provided second, third, fourth, etc since the 70s, as well as the more general nth/elt which just takes the index as an argum
220.
▲
by
kbp
9y ago
> It is entirely possible that the unwillingness of the Lisp community to give up in this obscure terminology in favor of something more user friendly contributed to its demise. What more-user-friendly terminology do you suggest?
221.
▲
by
kbp
9y ago
> If you want precise names to offer as aliases to "first" and "rest", then I think ML-style "head" and "tail" are better names than "car" and "cdr". I don't know what you
222.
▲
by
kbp
9y ago
> car and cdr worked for Lisp because, during the '70s, Lisp as a whole was novel enough to gain a sizable following. It doesn't work today. (And note that, even then, Lisp lost a lot of potential users due to the S-expression
223.
▲
by
kbp
9y ago
I think that's more attributable to the fact that for most people, their first 10 hours with Lisp are spent writing recursive functions that explicitly cdr down lists, rather than the names car and cdr. I think it would make a much big
224.
▲
by
kbp
9y ago
> Both seem better to me, as they have some meaning other than random made up strings (for people who don't use 704). Calling the lefthand child of a node in a binary tree the "first" and the righthand child the "rest
225.
▲
by
kbp
9y ago
> I assert that naming the interface for the implementation is almost always the wrong thing to do. I think it's perfectly acceptable if there aren't really any better names for the abstraction you're creating. car and cdr
226.
▲
by
kbp
9y ago
> Something other than CAR/CDR would have been a better choice for working with CONS cells, even back in 1959. > Are the names less than optimal? Yes. I don't think that's self-evident. The only better alternatives I&#x
227.
▲
by
kbp
9y ago
As noted earlier, the names first and rest date from the 70s and were already around in Lisp Machine Lisp. Also, to nitpick: in Racket, first (car) will sometimes throw when used on lists, too, if the list happens to be the empty list (whic
228.
▲
by
kbp
9y ago
Date: 5 March 1980 08:54-EST From: Mark L. Miller <MILLER at MIT-AI> To: Dave.Touretzky at CMU-10A, RWK cc: KMP, HIC, BUG-LISP Re: CAR and CDR Of course, you could rename them to, e.g., "LHS&
229.
▲
by
kbp
9y ago
> Left and Right are really commonly used in this situation in ML-descended languages. It’s not the worst thing. Are you talking about Either types? OCaml and Haskell at least both call car and cdr fst and snd respectively, but they'
230.
▲
by
kbp
9y ago
> > When Rich Hickey invented Clojure, he kept the gems of the LISP tradition, but jettison much of the muck. This is why Clojure has first instead of car and rest instead of cdr > Rich Hickey did not invent 'first' and &
231.
▲
by
kbp
9y ago
> So why stick with the names of 704 registers? Was there a purpose to this? Are there other, much better names for the two parts of a pair? First and second aren't great because they're not clear that it's a pair and not
232.
▲
by
kbp
9y ago
Stories are currently only available for English speakers learning French, German, Portuguese, and Spanish, but I think they're a really well-done kind of stepping stone from the regular Duolingo courses into a bit more in-context lear
233.
▲
Introducing Duolingo Stories (Beta)
(duolingo.com)
2 points
by
kbp
9y ago
|
1 comments
234.
▲
by
kbp
9y ago
> In Python it isn't implicit, but it's still shared state, and so still hard to test and maintain. You can't test the `f` in your example without having to pass in the whole big bundle of state that self tends to be, even
235.
▲
by
kbp
9y ago
> `class` has `self`, which is some kind of implicitly shared state that will bite you (harder to reason about, test and maintain). For reasoning about and maintaining, you can just think of `self` as an extra parameter to the function t
236.
▲
Ramda: A Practical Functional Library for JavaScript
(ramdajs.com)
1 points
by
kbp
9y ago
|
0 comments
237.
▲
How to Design a Nuclear Fallout Shelter
(tinyhousedesign.com)
1 points
by
kbp
9y ago
|
0 comments
238.
▲
by
kbp
9y ago
> These expressions are (or at least should be) functions on syntactic forms - syntax transformers. I don't really agree with this. Backquote is just shorthand for a bunch of consing that makes the end result more clear. Macros are
239.
▲
by
kbp
9y ago
Algol 68 is not the language most people mean when they say Algol, and was not a de facto standard language for publishing algorithms.
240.
▲
by
kbp
9y ago
You can challenge courses at most schools if you already know the material.
More ›