|
quote:CL-USER> (setf −1 0)
|
# ? Mar 23, 2012 16:16 |
|
|
# ? May 5, 2024 02:02 |
|
Beef posted:What, the *earmuffs* ? I think he means −1, which is actually considered a variable name. The difference is that it uses a − (character info: MINUS SIGN Unicode: U+2212, UTF-8: E2 88 92) instead of a - (character info: HYPHEN-MINUS Unicode: U+002D, UTF-8: 2D), and only - (hyphen-minus; U+002D) is considered a negative sign.
|
# ? Mar 25, 2012 09:10 |
|
Look Around You posted:I think he means −1, which is actually considered a variable name. The difference is that it uses a − (character info: MINUS SIGN Unicode: U+2212, UTF-8: E2 88 92) instead of a - (character info: HYPHEN-MINUS Unicode: U+002D, UTF-8: 2D), and only - (hyphen-minus; U+002D) is considered a negative sign. Its this exactly, but I think beef was just making a joke... Its the first time I've used a language this permissive with variable names, I should have understood faster from the error message what was up though, its pretty clear.
|
# ? Mar 25, 2012 15:18 |
|
Can you even make those with a normal keyboard
|
# ? Mar 25, 2012 20:04 |
|
Option+hyphen on a Mac.
|
# ? Mar 25, 2012 20:05 |
|
Ugh, I tried to get through Land of Lisp but realized in chapter 8 that I had no idea what was going on anymore. I don't know if I just didn't study the earlier examples enough or what, but I felt like it went from being an 'introduction' to being pretty intermediate-level wayy too quickly. Working through Practical Common Lisp now, it seems to be a bit better in that regard, though definitely less fun.
|
# ? Mar 25, 2012 21:06 |
|
mrobot posted:Ugh, I tried to get through Land of Lisp but realized in chapter 8 that I had no idea what was going on anymore. I don't know if I just didn't study the earlier examples enough or what, but I felt like it went from being an 'introduction' to being pretty intermediate-level wayy too quickly. I realize it's not CL but Clojure has a lot of good resources for beginners and it'll at least get you in the "Lisp mindset". My favorite is 4Clojure - http://www.4clojure.com/
|
# ? Mar 25, 2012 22:45 |
|
For the record common lispers take *earmuffs* around a variable name very seriously. It declares you have a global variable that follows dynamic scoping rules.code:
Beef fucked around with this message at 11:48 on Mar 28, 2012 |
# ? Mar 28, 2012 11:46 |
|
Fren posted:Clozure's fantastic. I'm going to be publishing an article Real Soon Now that uses it's foreign function interface support extensively. This article has made it to a first draft, and I'm looking for one or two people with experience in Lisp and Emacs Lisp to proofread the technical content. PM me for details.
|
# ? Apr 18, 2012 19:05 |
|
Is there a good, fairly up-to-date book/site that people like for getting into Clojure? I have a beginner's amount of Common Lisp under my belt and would like to be relying on information from reasonably new Clojure releases.
Catalyst-proof fucked around with this message at 16:58 on May 1, 2012 |
# ? May 1, 2012 16:56 |
|
I think that 4clojure.com works pretty well for getting the basics down
|
# ? May 1, 2012 17:00 |
|
Otto Skorzeny posted:I think that 4clojure.com works pretty well for getting the basics down Just don't try to take the value of a macro, I crashed the poo poo out of it a few months ago.
|
# ? May 1, 2012 17:01 |
|
Does anyone have a suggestion for a Common Lisp to run on Debian? I was going to go with Clozure owing to Fren's recent article, but it doesn't seem to be available via apt-get. I'd like something that integrates with the Debian way of doing things. (I suppose I could move to Ubuntu if that were necessary, but I've settled into Debian on my home development machine, it would be a PITA to move.) Suggestions (preferably from people with experience using them, more preferably with Emacs) are welcome. e: I suppose GNU CLISP is the Debian-blessed Common Lisp. I'll give that a try. Chime in if you have alternatives, though. pgroce fucked around with this message at 19:31 on Jun 9, 2012 |
# ? Jun 9, 2012 19:28 |
|
Clisp is fine for messing around, sbcl + slime/slimv/whatever is Real Neato if you stick with it
|
# ? Jun 9, 2012 19:47 |
|
pgroce posted:Does anyone have a suggestion for a Common Lisp to run on Debian? I was going to go with Clozure owing to Fren's recent article, but it doesn't seem to be available via apt-get. I'd like something that integrates with the Debian way of doing things. (I suppose I could move to Ubuntu if that were necessary, but I've settled into Debian on my home development machine, it would be a PITA to move.) Do you mean Clojure? It's in Debian: http://packages.debian.org/search?keywords=clojure 'aptitude search lisp' returns a bunch of stuff. sbcl and slime are there. I don't have a lot of experience with Lisp variants but just about anything popular is packaged for Debian.
|
# ? Jun 9, 2012 23:56 |
|
hannibal posted:Do you mean Clojure? Clojure is not a Commmon Lisp.
|
# ? Jun 10, 2012 00:16 |
|
hannibal posted:Do you mean Clojure? It's in Debian: http://packages.debian.org/search?keywords=clojure Nope, he means clozure
|
# ? Jun 10, 2012 02:47 |
|
My bad, I googled clozure but did not read closely enough.
|
# ? Jun 10, 2012 04:22 |
|
I was looking around some of the clojure projects on github and found a project named clojure-scheme, which compiles the clojurescript subset of clojure down to gambit scheme, which you can then compile to C and ultimately to machine code. I don't know how well the compiler works but it seems like a pretty awesome concept.
|
# ? Jun 13, 2012 01:07 |
|
Look Around You posted:I was looking around some of the clojure projects on github and found a project named clojure-scheme, which compiles the clojurescript subset of clojure down to gambit scheme, which you can then compile to C and ultimately to machine code. I don't know how well the compiler works but it seems like a pretty awesome concept. Not sure why anyone would actually use this. If Gambit Scheme is too obscure to write in, why is it not too obscure to use in your tool chain? I guess if you have a bunch of legacy Clojurescript code (without JS dependencies, I imagine). Not exactly a huge target user base. As a "do it because you can" project, though, I agree with you.
|
# ? Jun 13, 2012 19:08 |
|
Is this the only built-in way to compile Clojure to bytecode or does everybody just use lein and I should suck it up and use it, too?
|
# ? Jun 13, 2012 20:18 |
|
Mustach posted:Is this the only built-in way to compile Clojure to bytecode or does everybody just use lein and I should suck it up and use it, too? That's a messy page but the jist of it is if you are writing a clojure only app, then you don't need to do that. If you need to interop with Java or Scala or whatever, you can load clojure.lang.RT and load up your .clj files and it'll compile them on the fly. I find this to be the most flexible approach, however if you are unable or unwilling to distribute your source, then you need AOT compilation via the :gen-class mechanism in the ns macro (preferred way), or the gen-class function.
|
# ? Jun 13, 2012 20:40 |
|
trex eaterofcadrs posted:you can load clojure.lang.RT and load up your .clj files and it'll compile them on the fly.
|
# ? Jun 13, 2012 21:48 |
|
Mustach posted:This sounds fine. After thinking about it a bit more, compiling to bytecode may not be a requirement; my ultimate goal is to be able to jar everything up so the program can be run in the typical "java -jar" fashion. Yup that's a perfectly fine use of it. I did make a mistake though, you will probably want to load clojure.lang.Compiler for Compiler.load/loadFile and not RT (although in order to get stuff FROM clojure you will still need RT). Just make sure your clojure source is in the classpath somehow.
|
# ? Jun 13, 2012 22:35 |
|
pgroce posted:Does anyone have a suggestion for a Common Lisp to run on Debian? I was going to go with Clozure owing to Fren's recent article, but it doesn't seem to be available via apt-get. I'd like something that integrates with the Debian way of doing things. (I suppose I could move to Ubuntu if that were necessary, but I've settled into Debian on my home development machine, it would be a PITA to move.) clisp is the most compatible, runs nearly everywhere, but is dog slow. sbcl is the most active open-source implementation, everything is native compiled and really fast. For Emacs, use SLIME. Try out paredit as editing mode if you are feeling adventurous.
|
# ? Jun 14, 2012 11:44 |
|
I'm having an issue getting some really simple clojure code to work with lein for project euler, but it's having trouble with it. I'm getting unresolved symbol exceptions when I try to run it with lein run trampoline -m euler.core. Here's the code: code:
I also had issues while trying to use :require euler.p1 :as p1 and replacing solve-p1 with p1/solve (and renaming solve-p1 to solve obviously). Does anyone know what's going on with this? Here's what's printed when I try to run it (with a couple manual linebreaks to not break tables) code:
|
# ? Jun 16, 2012 20:17 |
|
quote:From what it looks like, the clojure compiler/interpreter is only doing a one-pass compilation and is making GBS threads itself when it gets to the call to nonexistant-problem in answer. Clojure has a one-pass compiler so you need to either (declare nonexistant-problem) before calling it, or just move the function definition above it. quote:I also had issues while trying to use :require euler.p1 :as p1 and replacing solve-p1 with p1/solve (and renaming solve-p1 to solve obviously). It should look like (:require [euler.p1 :as p1]). If this is how you have it, then I'm not sure.
|
# ? Jun 16, 2012 20:49 |
|
jjttjj posted:Clojure has a one-pass compiler so you need to either (declare nonexistant-problem) before calling it, or just move the function definition above it. Actually clojure has a two-pass compiler, it's just that the compilation unit is a single form
|
# ? Jul 29, 2012 18:48 |
|
I'd like to build a web app in Racket. Should I tough it out, and build it up from instaweb, or are there other tools that I could use to make it a bit easier for myself? I'd like something well-maintained, and actively developed, my greatest fear is learning a framework and then finding out the developer abandoned it for something else. Also, has anyone here built any substantial web apps in racket? What was it like? How was it different from writing a web app in RoR or nodejs? Cumulative Self-lulz Caused: Bans: 0 | Probations: 6 Days 6 hours 15 min | Lang: Racket, Ruby | Public Projects: (none so far) |
|
# ? Oct 25, 2012 05:10 |
|
I love Scheme, but the thought of using it for any kind of serious development work makes me shudder. Can't help you with racket webservers, but you might want to look at Hop: it's built on the Bigloo compiler to translate directly to Javascript and pretty much the most painless server/client code model I've seen for the web. http://en.wikipedia.org/wiki/Hop_(software) If you want to get serious with Lisp, there are a variety of Common Lisp webservers that are still in active development. And dear god man, lose that sig.
|
# ? Oct 25, 2012 11:31 |
|
Beef posted:I love Scheme, but the thought of using it for any kind of serious development work makes me shudder. Care to expand on this? What do you think Scheme's sweet spot is, and why would it be inappropriate for large-scale/"serious" work? I'm just curious. I've never used Scheme (or much lisp at all, outside of Emacs and a little tiny bit of Clojure), and I also find it a bit unusual for someone to like a general-purpose language, but still not consider it viable for real work. Is it just a support thing (flaky libraries, unstable community, etc.), or a core issue with the language itself?
|
# ? Oct 25, 2012 14:02 |
|
pgroce posted:Care to expand on this? What do you think Scheme's sweet spot is, and why would it be inappropriate for large-scale/"serious" work? For one thing, Scheme regularly benches 20-30x faster than ruby or python, and has repeatedly proven itself a staple of the lisp family. To be clear, I'm not bashing Common Lisp, I'm just bringing some needed attention to Racket. Racket has a centralized module system, hygienic macros, and even an optional static type to help you keep track of everything when the system is too complex. Cumulative Self-lulz Caused: Bans: 0 | Probations: 6 Days 6 hours 15 min | Lang: Racket, Ruby | Public Projects: (none so far) |
|
# ? Oct 25, 2012 15:19 |
|
Scheme, at its core, is an educational and academic language. It originated with some smart guys trying to figure our that new fancy Actor and OO stuff that was emerging in academia. This led to the publications of the famous lambda papers by Steele and Sussman. Then of course its educational use by way of SICP. Its basic tenant is that code should be readable and understandable first, but only incidentally executable by a computer. The core of Scheme was kept as small and simple as possible, trying to reduce computation to its bare necessities. It produced some wonderful concepts such as closures to capture state and and continuations to capture control flow. The sweet spot of Scheme is when used in an educational or academic setting. For instance, expressing an algorithm on a single slide, precise but concise, without regard for accidental complexity that arises when programming in the real world. The small language core and complete lack of syntax make it a perfect introductory programming language. It's powerful enough to give a tour of multiple programming paradigms, as they do in SICP. Additionally, the small core also means you can go balls-deep and write a meta-circular interpreter, show changes to the language and even cover compilers and garbage collection. Did I mention the small language? The R5RS standard is around 40 pages, we distribute it as handouts during exams. Of course, programming in the Real World means you suddenly cannot cut a lot of corners. Suddenly your code has to cooperate with other systems, libraries and a fuckton of edge cases. You need a module system, FFI, a good compiler. Especially that last one suddenly means that you need to compromise on your language features. Unbounded reentrant call-cc becomes a ball in chain for your performance, which is only really needed in a tiny number of real applications. Then there is the problem of having to write your own implementation of every little operation that would be built-in in any sane industrial language. This point is best argued by Guy L. Steele's, the man himself, keynote in his "Growing a language" keynote: https://www.youtube.com/watch?v=_ahvzDzKdB0. Tail-calls and ADT closure objects are fine in the classroom. But for any serious work, you would have to be insane to prefer it to Common Lisp's loop construct and defstructs. Different implementations will probably offer such extra functionality, but each come with their own quirks and potential that the Scheme vendor will break your code whenever they feel like changing something. Personally, I think the push to make Scheme a more serious and industrial language is the worst thing to happen to Scheme. Vendors like Racket sit on the committee to push for more feature-rich standards; R6RS document more than quadrupled in size suddenly. This makes Scheme a more sane programming language for industry, certainly. The beauty of pre-R6RS Scheme was that you could just tell them to type (+ 1 1) and then move on with the meta-circular interpreter (so to speak). But suddenly, there is no more REPL, you have to start your CS101 class by explaining the module system at the top, why they can't put their defines where they want and what immutable datastructures are. In short, making Scheme a more serious language necessarily moves it away from why it is such a great language in the first place. quote:To be clear, I'm not bashing Common Lisp, I'm just bringing some needed attention to Racket. Racket has a centralized module system, hygienic macros, and even an optional static type to help you keep track of everything when the system is too complex. Common Lisp already has a centralised module system, a much more powerful macro system, optional type system, arguably the most powerful OO system and decades of experienced developers using it to build real applications in any domain imaginable. I love Scheme, but moving the language in the direction that Racket is taking it would put it in an awkward middle-ground. What Racker does do well though, is to give you a lot of tools to build your own little language.
|
# ? Oct 25, 2012 17:18 |
|
I'm really just wondering if Racket's webserver/insta is sufficient, or should I use something from PLaneT.
Cumulative Self-lulz Caused: Bans: 0 | Probations: 6 Days 6 hours 15 min | Lang: Racket, Ruby | Public Projects: (none so far) | luxxx fucked around with this message at 17:48 on Oct 25, 2012 |
# ? Oct 25, 2012 17:40 |
|
Beef posted:
Ah. So the strength of Scheme (R5RS) is its simplicity and economy of expression, which was mostly useful in teaching and academic communication. That's reasonable. Maybe there's room in the world for R5RS and Racket/R6/etc. to exist as "the Platonic form of Scheme" and the "real-world" language based on it that people move on to when they're ready to get their feet wet. I certainly hate that people learn all these interesting and powerful formalisms in school, then get out into the world and learn to lock that part of their education away to die because it's all Java and C and Python out there, buddy. Thanks for the info.
|
# ? Oct 25, 2012 19:29 |
|
pgroce posted:Ah. So the strength of Scheme (R5RS) is its simplicity and economy of expression, which was mostly useful in teaching and academic communication. That's reasonable. R7RS is going to make that split. There's going two varieties: scheme "small" and scheme "big" for both kinds of usages. Back in February they were on the 6th draft of the "small" version -- I'm not aware whether they've began work on the "big" variety as of now.
|
# ? Oct 25, 2012 20:10 |
|
I don't want to interrupt the scheme discussion, but I have another quick question. What DB has the best Common Lisp support? I was thinking mongo at first, but the driver I found is a few months out of date.
Cumulative Self-lulz Caused: Bans: 0 | Probations: 6 Days 6 hours 15 min | Lang: Racket, Ruby | Public Projects: (none so far) |
|
# ? Oct 25, 2012 20:58 |
|
luxxx posted:I don't want to interrupt the scheme discussion, but I have another quick question. What DB has the best Common Lisp support? I was thinking mongo at first, but the driver I found is a few months out of date. Mongo isn't a DB. Try PostgreSQL. Edit: Actually try RethinkDB which is, in fact, written in Common Lisp! shrughes fucked around with this message at 03:52 on Oct 26, 2012 |
# ? Oct 26, 2012 03:49 |
|
Talking of real-world stuff with Scheme. If you're doing arduino-like embedded programming, check out Armpit Scheme. We've been using it for a few years to get students to do some bit-level fuckery without leaving the kiddiepool. The interpreter is a bit slow to manually drive a serial bus or realtime work, but you can work around this by adding some primitives yourself (e.g. driving an lcd screen). The armpit interpreter was about 20k lines of ARM asm last time I looked, but it's relatively simple to follow.
|
# ? Oct 26, 2012 12:47 |
|
|
# ? May 5, 2024 02:02 |
|
shrughes posted:Mongo isn't a DB. Try PostgreSQL. Hasn't been update in more than a year, I decided on PG. Cumulative Self-lulz Caused: Bans: 0 | Probations: 6 Days 6 hours 15 min | Lang: Racket, Ruby | Public Projects: (none so far) |
|
# ? Oct 26, 2012 15:57 |