Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
stevelosh
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
11 ms
·
31.
▲
by
stevelosh
7y ago
I looked over the Common Lisp version at https://github.com/niofis/raybench/blob/master/lisprb.lisp and it's… really bad, in a lot of ways. (declaim (optimize (speed 3) (safety 0) (space 0) (d
32.
▲
by
stevelosh
7y ago
They mean remapping capslock to: * Ctrl if held and used with other keys. * Esc if pressed and released on its own. There's no reason to press and release Ctrl on its own (minus games), and you never need to chord Esc with anything els
33.
▲
by
stevelosh
8y ago
sjl at alephnull in ~/Desktop ><((°> sbcl [SBCL] CL-USER> (defparameter *name* "World") *NAME* [SBCL] CL-USER> (defun foo () (format t "Hello, ~A~%" *name*))
34.
▲
by
stevelosh
8y ago
"NO" being false is particularly fun: - languages: - en # english - is # icelandic - no # norwegian - ja # japanese - fr # french [{"languages": ["en", "is", f
35.
▲
by
stevelosh
8y ago
Lisp user here. I'll chime in with another example of using macros for more than just delaying evaluation. I wrote a library called Chancery[1] for procedurally generating strings (and other data). It's inspired by Tracery[2] bu
36.
▲
by
stevelosh
8y ago
> Dev didn't say they made a Common Lisp -- just a Lisp. The first line in the README after the title is: > A Common Lisp Interpreter Built in COBOL.
37.
▲
by
stevelosh
8y ago
Common Lisp http://www.lispworks.com/documentation/lw70/CLHS/Body/m_defs... http://clhs.lisp.se/Body/m_defcla.htm
38.
▲
by
stevelosh
8y ago
You don't have to even have to deftype it -- there's a built in boolean type: http://clhs.lisp.se/Body/t_ban.htm
39.
▲
by
stevelosh
8y ago
I don't think adding debug/safety 0 are really worth it. In this: (declaim (optimize speed) (ftype (function (fixnum) fixnum) fib)) (defun fib (n) (if (<= n 1) 1 (+ (fib (- n 1))
40.
▲
by
stevelosh
8y ago
I agree with this. The error messages in most Common Lisp environments are just so much better than you get in languages like Clojure or C# or Python. I even have a good example to illustrate this. A while back someone had emailed me be
41.
▲
by
stevelosh
8y ago
> the REPL buffer is read-only which is quite bizarre to me The way I work around this is to run the SBCL process inside a Neovim terminal split (with rlwrap). That way I get a vanilla SBCL REPL plus the stability of Vlime.
42.
▲
by
stevelosh
8y ago
I've tried both. Slimv was always very buggy for me, especially the REPL buffer. I think this was because it was made long before any of the new Vim async stuff existed, and so had to do a lot of ugly hacks to get a reasonable REPL.
43.
▲
by
stevelosh
8y ago
I agree with this -- it's a real problem. My only solution has been to try to be the change I want to see in the world and document all of my own libraries before I officially release them.
44.
▲
by
stevelosh
8y ago
I don't know that I'd go so far as to call it my main motivation, but it is absolutely one of the strongest motivators, yes.
45.
▲
by
stevelosh
8y ago
You can try to make it less shoutey by messing with readtable-case[1] but in my experience that's more trouble than it's worth. I found the uppercase a bit obnoxious at first too, but it's grown on me over time and now I f
46.
▲
A Road to Common Lisp
(stevelosh.com)
343 points
by
stevelosh
8y ago
|
92 comments
47.
▲
by
stevelosh
8y ago
Common Lisp avoids the confusion of "which one am I using" by giving you two separate functions, MOD and REM: http://clhs.lisp.se/Body/f_mod_r.htm
48.
▲
by
stevelosh
8y ago
If you tried reading SICP in the past but it didn't quite click, you might want to try watching the lectures as you read it: https://www.youtube.com/playlist?list=PLB63C06FAF154F047
49.
▲
by
stevelosh
8y ago
Alexandria's versions are basically the same as the "multiple bindings" versions, about halfway through the post[1]. So they are explained/compared/discussed... I just didn't mention that those versions happe
50.
▲
by
stevelosh
8y ago
You'd need to parse out the declarations, yeah. Otherwise they'd get shoved inside the progn which wouldn't work.
51.
▲
by
stevelosh
8y ago
The "anaphora" in "anaphoric" typically refers to how it binds the variable "it" automatically, without having to specify the variable name. Since if-let and when-let require you to explicitly specify the vari
52.
▲
by
stevelosh
8y ago
> What’s a example of these macros being used usefully? Sure, here are a couple examples I found from grepping my src directory. roguelikelike game I made for a game jam: https://github.com/sjl/vintage/blob/
53.
▲
Fun with Macros: If-Let and When-Let
(stevelosh.com)
97 points
by
stevelosh
8y ago
|
30 comments
54.
▲
Fun with Macros: Gathering
(stevelosh.com)
59 points
by
stevelosh
8y ago
|
6 comments
55.
▲
by
stevelosh
9y ago
This book is excellent. The AI stuff might be a little dated, but if you've read some intro to Common Lisp books and want to learn more about how to use the language, this is a great place to dive in. As someone mentioned, this partic
56.
▲
by
stevelosh
9y ago
Have fun: http://joon.be/portfolio/canabalt-100/
57.
▲
by
stevelosh
9y ago
> Actually, in general Julia is surprisingly Lispy for a language with Algol-family syntax. It's less surprising if you know there's still a version of the Julia REPL that works with sexpressions: https://youtu.be&#x
58.
▲
by
stevelosh
9y ago
Last I heard they were looking for a maintainer: http://article.gmane.org/gmane.lisp.clisp.general/14256 Has someone stepped up?
59.
▲
by
stevelosh
9y ago
This book comes up in #lisp on freenode every so often, and the channel is generally split on whether or not to recommend it. I generally do. It's fun and lighthearted. Using games as a medium to teach the language is something some
60.
▲
by
stevelosh
9y ago
By "text" do you mean "SVG code that is rendered into images the user can click on"? Because that's what it's doing: https://i.imgur.com/iqdZ8l4.png and I think calling that a "text based
More ›