|
I've found paredit mode obnoxious in the repl and useless in the editor and disabled it in slimv, but I'm allergic to metakeys so ymmv
|
# ? Mar 6, 2012 03:39 |
|
|
# ? May 5, 2024 06:29 |
|
One day paredit will make sense to me and I'll go through a complete session using it without screaming at my editor like a howler monkey as it moves the cursor around indiscriminately. It took me a couple of tries for Emacs to make sense to me, so you never know.
|
# ? Mar 6, 2012 04:35 |
|
You have to get used to its peculiar way of doing things; it takes a few days of forced paredit usage and the cheat-sheet stickied next to your monitor. Also, it makes me want to fix the thread title using M-s (splice sexpr)
|
# ? Mar 6, 2012 13:24 |
|
Beef posted:You have to get used to its peculiar way of doing things; it takes a few days of forced paredit usage and the cheat-sheet stickied next to your monitor. I probably could've done the title as (define (thread lang . posts) (show posts)) (thread lisp posts) (scheme style) since I don't know CL that well, but I used the explicit lambda and I put it in parens because more parens is better right e: the extra parens took it out of the top level too In my defense I was getting increasingly less focused because I was bored as hell in a recitation but still trying to act like I wasn't doing other poo poo. Look Around You fucked around with this message at 19:24 on Mar 6, 2012 |
# ? Mar 6, 2012 19:15 |
|
duck monster posted:
I got a chance to eat breakfast and lunch with Dr. and Mrs. Sussman at Strange Loop last September. He is amazingly bright and speaks super loving fast when he's talking about math, holy poo poo. She is super nice and I think she knows her husband is way too smart to talk to near-norms like me. She gave me one of his magazines from MIT as a consolation prize I think.
|
# ? Mar 6, 2012 19:30 |
|
jstirrell posted:I was about to answer your question, then I found this in the process which pretty much explains exactly what I was going to say better than I could: I love clj and have been digging around the compiler (ugh) and innards for the better part of a year now. I'd love a clojure thread if there's enough interest separate from the lisp thread here.
|
# ? Mar 6, 2012 19:34 |
|
TRex EaterofCars posted:I love clj and have been digging around the compiler (ugh) and innards for the better part of a year now. I'd love a clojure thread if there's enough interest separate from the lisp thread here. A bunch of people on IRC were going through 4clojure and chatting about it, so there might be. I'd be interested in a discussion about whether or not Clojure (and other similar non-lisp languages) really are the future for concurrency, but I also don't know enough about the subject to participate much.
|
# ? Mar 7, 2012 00:18 |
|
Regarding Clozure, it seems someone just put up a mac appstore app that uses Clozure: http://clozure.com/pipermail/openmcl-devel/2012-March/013433.html quote:Hi CCL Users -
|
# ? Mar 7, 2012 15:30 |
|
etcetera08 posted:I'm reading through Land of Lisp and working on OS X. I had trouble brew install'ing CLISP so I'm running Clozure CL for now. Is this an acceptable implementation? I am sort of unsure of how much variation there is between all the different versions. Hmm weird, I recently installed clisp on Snow Leopard via "brew install clisp" without any problems. I just started in on Land of Lisp a few days ago and it's fantastic. One of the things I like about Lisp so far is the transparency of it -- it has a lot of high-level elegance and abstraction, but you also get a very good sense of how the program is working "under the hood", in a way that almost reminds me of assembly language. One of my big "whoa" moments was realizing that the REPL (the read-evaluate-print loop, Lisp's interpreter mode) can be written in Lisp as code:
Also I'm very happy with using SLIME + Emacs, makes it very elegant to go back and forth between a source file and the REPL. Granted, I already knew my way around emacs (I have enough fingers, as it were), but given that emacs is built around Elisp, it's given me a fresh appreciation for a lot of things (especially customizations).
|
# ? Mar 8, 2012 23:54 |
|
For people who'd like a lisp made for some concurrency, there are two dialects of lisp running on the Erlang VM, Joxa and LFE. They allow you to access all of the concurrency and fault-tolerance primitives of the Erlang VM, and although I haven't used Joxa much, I know LFE goes the extra mile to keep full compatibility with things like pattern matching.
|
# ? Mar 9, 2012 01:00 |
|
I like the idea of lisp, everyone seems to talk about it in a zen like way and it seems to carry a lot of nerd points, I just really haven't had the motivation to work with it in any real way. What is so good about it? is there a specific domain of problems where it is particularly good?
|
# ? Mar 9, 2012 01:22 |
|
That's a superbly difficult question to answer. Imagine if you had a programming language that not only was its own abstract syntax tree, but provided a compile-time expansion language that was itself, giving you the full power of the language to have the compiler write the code that you're too lazy to. That's the top inch of the tip of the iceberg of the answer to your question. I'd recommend http://www.defmacro.org/ramblings/lisp.html as a slightly more in-depth attempt at an answer, but it's very much one of those things you need some practice at to see as useful. Other, more practical points: Lisp is old as computers, with a battle-tested, comprehensive specification and dozens of implementations to choose from. It's fast, and tools to work with it are as solid as the language (Thinking specifically of SLIME and Emacs), implementing IDE-like functionality decades before IDEs existed (save Smalltalk, I suppose). Garbage collection, object orientation, and a host of other language features you may take for granted existed in one form or another in Lisp as afterthoughts before you were born. There was even a time of the Lisp machines, computers that were Lisp down to the metal, giving you that extensibility, functionality, and expressiveness system-wide. Other, more vague points: Lisp is closely related to the lambda calculus, an elegant branch of mathematics that formalizes functions as a mathematical construct. Grokking Lisp can very quickly lead to a sort of Zen-like understanding of computation itself. (So I've heard! I am not so arrogant to say I've gotten there myself.) Catalyst-proof fucked around with this message at 01:39 on Mar 9, 2012 |
# ? Mar 9, 2012 01:32 |
|
unixbeard posted:I like the idea of lisp, everyone seems to talk about it in a zen like way and it seems to carry a lot of nerd points, I just really haven't had the motivation to work with it in any real way. What is so good about it? is there a specific domain of problems where it is particularly good? Even without getting into the more zen stuff, Lisp is a really well-executed dynamic language that happens to also be much more performant than other dynamic languages. It's fun to write. It's more expressive than Perl* and more elegant than Python**. The tools built up around it (eg. SLIME/SLIMV) are awesome and make me probably 2x as productive on their own. The idiomatic style grows on you really, really quickly (in my case, the canonical indentation is still suboptimal but I turn on rainbow parens and deal with it, but the semantics are what really matter anyways). *Except for munging text and a couple other things Perl has poured the whole bowl of sugar on **Except for format and loop
|
# ? Mar 9, 2012 04:39 |
|
Otto Skorzeny posted:(in my case, the canonical indentation is still suboptimal but I turn on rainbow parens and deal with it, but the semantics are what really matter anyways). That's one thing I don't understand, having gone through the first 100 pages or so of Land of Lisp.. I don't understand the indentation at all, unless it's specifically explained. I mean, I understand the general format but sometimes there are things just indented a couple spaces or something that doesn't make sense to me. Is there a conventional style guide somewhere I can browse?
|
# ? Mar 9, 2012 06:03 |
|
etcetera08 posted:That's one thing I don't understand, having gone through the first 100 pages or so of Land of Lisp.. I don't understand the indentation at all, unless it's specifically explained. I mean, I understand the general format but sometimes there are things just indented a couple spaces or something that doesn't make sense to me. Is there a conventional style guide somewhere I can browse? This seems to be a good summary I guess.
|
# ? Mar 9, 2012 06:08 |
|
Look Around You posted:This seems to be a good summary I guess. Ah this is very helpful, thanks!
|
# ? Mar 9, 2012 06:12 |
|
etcetera08 posted:That's one thing I don't understand, having gone through the first 100 pages or so of Land of Lisp.. I don't understand the indentation at all, unless it's specifically explained. I mean, I understand the general format but sometimes there are things just indented a couple spaces or something that doesn't make sense to me. Is there a conventional style guide somewhere I can browse? Tbh vim and emacs auto-indent things according to it and I just live with it. As long as you hit the enter key at the right time you don't need to worry about aligning crap, it's done for you reasonably well. I mean, I straight up dislike the use of indentation instead of a vertically aligned closing delimiter to tell where a block ends. It takes more time for me to do it, and the problem is worse in Lisp than in Python or Haskell due to the shape the code tends to take, but technical means (from rainbow parens to the worst case scenario of bouncing on the % key) ameliorate this to the point that idgaf. It also seems to be less of an issue if you're factoring reasonably well. Eg this is perfectly readable even without vertically aligned end delimiters: code:
|
# ? Mar 9, 2012 06:20 |
|
Otto Skorzeny posted:Tbh vim and emacs auto-indent things according to it and I just live with it. As long as you hit the enter key at the right time you don't need to worry about aligning crap, it's done for you reasonably well. I think that keeping closing parens all on the same line makes lisp code a bit more readable and understandable tbh. In lisp I'm thinking about things as forms and stuff, and it's easy enough to figure out what's going on by the first term in an s-expression and the subsequent indentation. I think it goes back to the whole "it's all a list" thing instead of there being a difference between statements and expressions and blocks or w/e in more traditional languages. Like that lisp code I'd be fine with and it's extremely readable, but code:
e: actually, I think part of it is because in lisp, the form is entirely closed in parens (ex: (if (cond) (then) (else)) ) instead of the form being bare and then being followed by the block (ex: if (cond) { this; } else { that } ) Look Around You fucked around with this message at 07:39 on Mar 9, 2012 |
# ? Mar 9, 2012 07:26 |
|
The semi-joke is that you ignore parens after a while, so you use the indentation to follow nesting. Parenthesis are not that important that they need their own specially dedicated line in your code. In the end, there is no reason to not follow good style, and that includes indentation. You catch a lot of bugs with it and makes your code easier to mentally parse. Something is very wrong when you have to mentally match parens yourself. We do yell at our students when they can't be bothered to properly break up and indent there code. All you need to do is hit loving tab in Racket/Lisp ffs. Programming projects always have a few points allocated to 'code style'. Common Lispers have created a general consensus over style from over half a century of formatting their code. You will vastly improve the readability of your code for other lispers if your style fits in their expected pattern. I would format the above as: code:
Additionally, most Lispers reserve the '(<expr> <newline>' indentation style for expressions that do not take any arguments, such as for example 'progn' or Scheme's 'begin'. code:
Or a function call, where all arguments are equal. code:
Is something-magical that does some magical macro stuff? Then indent it as such to make it clear to the reader. For example if something-magical is a macro that does something weird, not treating all its arguments equally at all, then it should be obvious from it's usage: code:
code:
I recommend reading Tutorial on Good Lisp Programming Style by Norvig and Pitman. It will make you a better programmer, no matter the language.
|
# ? Mar 9, 2012 13:55 |
|
Beef posted:Wow, great advice. Thanks.
|
# ? Mar 9, 2012 16:11 |
|
Otto Skorzeny posted:Tbh vim and emacs auto-indent things according to it and I just live with it. As long as you hit the enter key at the right time you don't need to worry about aligning crap, it's done for you reasonably well. I hate cdaddadadaddar crap, I've been spoiled by clojure's pervasive destructuring. Here's how I would do that in clojure, if anyone is curious what destructuring can do for you. code:
|
# ? Mar 9, 2012 17:16 |
|
Common Lisp definitely has destructuring binds. Also no one should still be using car, cdr, and its offspring over nth.
|
# ? Mar 9, 2012 17:36 |
|
As you should always choose the most specific/applicable function. Use (car foo) if foo is a cons (first foo) if foo is a list cdadr magicians will be shot on sight, use loving defstruct or abstract datatypes. I suspect they are used in Land of Lisp to make the code examples easier to write, in the sense that you take less time to copy them from the book. A little how those write-your-own-game books were also programs optimized for number of characters.
|
# ? Mar 9, 2012 17:43 |
|
ca*d*a*r bullshit isn't so bad if you actually name it something meaningful. That said I don't think I'll ever forget Beef posted:cdadr magicians will be shot on sight, use loving defstruct or abstract datatypes. hahahhah
|
# ? Mar 9, 2012 17:52 |
|
cdaddaddaar has the compelling advantage of that it's a lot more fun to say.
|
# ? Mar 9, 2012 17:59 |
|
Fren posted:Common Lisp definitely has destructuring binds. Also no one should still be using car, cdr, and its offspring over nth. Do they work everywhere or do you need to use destructuring-bind explicitly?
|
# ? Mar 9, 2012 19:34 |
|
Beef posted:Style stuff Thank you for a really informative and helpful post! Re: the labels bit, I had been mentally mulling over that for a while, the let-style definitely looks better. Re: the cdadr stuff, what should I read up on wrt. destructuring? I tried to insulate myself from the cdadr bullshit (as it was eloquently put) with those local functions (as the docstring from that fragment implies, basically I want to take some information from a bunch of intermittently nested lists and put it into an alist and a hash; the stuff comes from an XML file that represents the dependency graph for a build system which XMLS sexpr-izes), but if there's a better way to implement those defs I'd like to learn it
|
# ? Mar 9, 2012 20:52 |
|
Well, IIRC this is the main form for destructuring in CL. The link on there for destructuring lambda lists explains the syntax.
|
# ? Mar 10, 2012 00:27 |
|
Anyone going to Clojure/West this weekend?
|
# ? Mar 14, 2012 21:46 |
|
Plorkyeran posted:cdaddaddaar has the compelling advantage of that it's a lot more fun to say. This is almost exactly the justification Sussman gives in the SICP video lectures.
|
# ? Mar 16, 2012 04:45 |
|
Have any of you tried Arc by Paul Graham? I learned CL from his books and I've noticed he is in the process of designing this new dialect of Lisp. From the looks of his website, it doesn't seem very popular / finished, but I was wondering if any of you have gotten around to playing with it.
|
# ? Mar 19, 2012 21:23 |
|
theratking posted:Have any of you tried Arc by Paul Graham? I learned CL from his books and I've noticed he is in the process of designing this new dialect of Lisp. It's a hundred-year language, in that it'll take a hundred years for it to become useful.
|
# ? Mar 20, 2012 03:26 |
|
That's too bad, I always liked Graham, my first foray into lisp was from his book ANSI common lisp that my teacher gave me. I had hoped he would come up with something cool. on a side note: do any of you have good resources for learning lisp-like macros? Is there something like defmacro in Scheme or should I just use CL. edit: a d
|
# ? Mar 20, 2012 07:01 |
|
theratking posted:That's too bad, I always liked Graham, my first foray into lisp was from his book ANSI common lisp that my teacher gave me. Scheme has macros but they're a bit different than CL. Scheme uses hygenic macros vs. CL's non-hygenic ones. There's a lot of debate about which is "better"; CL macros are simpler, but scheme's are safer. e: Here is an FAQ about scheme's macros.
|
# ? Mar 20, 2012 07:24 |
|
theratking posted:Have any of you tried Arc by Paul Graham? I learned CL from his books and I've noticed he is in the process of designing this new dialect of Lisp. Well, he talked about it, how important it would be, how ground changing, etc. Then he released a bunch of lisp macros. Notably: A bunch of lisp macros that went out of their way to *elminate* unicode support in the host language, MzScheme. quote:From the looks of his website, it doesn't seem very popular / finished, but I was wondering if any of you have gotten around to playing with it. The thing is, every lisp user does this - after a certain period of time they end up writing macros, and re-writers so they can write in their own little special dialect. Paul Graham isn't unique or special in this regard.
|
# ? Mar 20, 2012 09:18 |
|
tef posted:The thing is, every lisp user does this - after a certain period of time they end up writing macros, and re-writers so they can write in their own little special dialect. Paul Graham isn't unique or special in this regard. By this definition, the limit of lisp as lisp approaches completion is...Haskell.
|
# ? Mar 20, 2012 16:36 |
|
Paul Graham is too busy raking in money hand over fist doing YCombinator. Can't say I would fault him for stagnating on Arc.
|
# ? Mar 20, 2012 21:15 |
|
STupid newbie question time: I've been going through the Land of Lisp and one of the examples (orc-battle) isn't working for me. its crashing on line 54, when performing the following command: (ash *player-strength* −1) with the error "*** - CASE: variable −1 has no value" I replaced this with: (floor (/ *player-strength* 2)) which works, but I'd love to know what is actually happening here? here is the full game and here is the error and back trace Edit: I figured it out, its a copy past error: minus symbol is not the same as dash symbol. Dirty Frank fucked around with this message at 11:06 on Mar 22, 2012 |
# ? Mar 22, 2012 11:03 |
|
That's an awesome variable name, I'm gonna start using it.
|
# ? Mar 22, 2012 18:18 |
|
|
# ? May 5, 2024 06:29 |
|
What, the *earmuffs* ?
|
# ? Mar 23, 2012 15:58 |