2009-01-21
| 00:13 | cooldude127 | so around what time at night does this channel DIE? |
| 00:15 | durka42 | i suppose it depends what you mean by night |
| 00:15 | durka42 | i imagine people in germany and such are up earlier than i am |
| 00:16 | cooldude127 | ah |
| 00:16 | Chouser | I've been meaning to try to chart the by-hour traffic rate for the average week. |
| 00:16 | cooldude127 | idk it's night where i am and this place is dead |
| 00:16 | hiredman | ,(Integer/parseint "0" 2) |
| 00:17 | hiredman | wait |
| 00:17 | Chouser | ,(Integer/parseInt "0" 2) |
| 00:17 | Chouser | he's not here |
| 00:18 | cooldude127 | wtf clojurebot? |
| 00:18 | hiredman | anyway |
| 00:19 | hiredman | I fixed my brain so I know what (Integer/parseInt "0" 2) is |
| 00:19 | cooldude127 | ,(Integer/parseInt "0" 2) |
| 00:19 | clojurebot | 0 |
| 00:19 | hiredman | I sure wish I typed that in on of my repls instead of to clojurebot |
| 00:20 | cooldude127 | why? |
| 00:20 | hiredman | because 0 in base two is still 0 |
| 00:20 | cooldude127 | lol |
| 00:20 | cooldude127 | ,(Integer/parseInt "10010101" 2) |
| 00:20 | clojurebot | 149 |
| 00:20 | cooldude127 | woo! |
| 00:22 | durka42 | what's the darcs equivalent of git clone? |
| 00:22 | durka42 | is it get? |
| 00:22 | cooldude127 | yes |
| 00:22 | cooldude127 | darcs get |
| 01:36 | Cark | how do i remove a def from a namespace ? |
| 01:40 | durka42 | (doc ns-unmap) |
| 01:40 | cgrand | (doc ns-unmap) |
| 01:40 | clojurebot | Removes the mappings for the symbol from the namespace.; arglists ([ns sym]) |
| 01:40 | clojurebot | Removes the mappings for the symbol from the namespace.; arglists ([ns sym]) |
| 01:40 | cgrand | :-) |
| 01:40 | Cark | ah thanks |
| 01:42 | durka42 | (ns-unmap *ns* 'durka42) |
| 03:20 | jli | combinatorics will be the end of me. |
| 03:28 | hiredman | ,(� S K K :a) |
| 03:28 | clojurebot | :a |
| 04:19 | ecret | i know how to include jar files when using the shell, just include the jars in the 'java -cp xxx.jar clojure.lang.Script file.clj" But I use jochu's emac's addon and am unsure of how to tell it where to look for the jar file. I tried adding the jars to the classpath but doesnt seem to work. |
| 04:37 | jli | wait, so is Clojure under the Eclipse license or the Common Public License? |
| 04:38 | jli | clojure.org says CPL, Google Code says EPL |
| 04:40 | hoeck | ecret: do you use slime too? for slime (swank-clojure) there is [m-x] customize-group [RET] swank-clojure |
| 04:40 | ecret | hoeck: yes i use slime |
| 04:40 | hoeck | jli: the latter |
| 04:41 | hoeck | ecret: and you need to restart emacs after adding a classpath there |
| 04:42 | ecret | hoeck: neat. Do I add classpaths or library paths? |
| 04:43 | hoeck | thats the same in clojure |
| 04:48 | ecret | hoeck: my default classpaths it seems was ~/.clojure even though i had set my classpaths=anotherfolder in my .emacs file. So I copied my jars into ~/.clojure and it still dont think its working. Is there a command to check which jars are loaded? |
| 04:48 | ecret | in the repl |
| 04:50 | jli | this page isn't only blank for me, right? http://clojure.org/repl_and_main |
| 04:50 | karmazilla | jli: maybe it is in the process of being written |
| 04:50 | jli | just making sure |
| 04:50 | hoeck | mhh, I don't know one, but to recognize jars you need ~/.clojure/* as a classpath, * adds all jars in this directory to the classpath |
| 04:51 | hoeck | @ecret |
| 04:55 | hoeck | ecret: but you can eval (swank-clojure-cmd) in your emacs *scratch* buffer to take a look at how clojure gets started |
| 05:10 | djpowell | I need to write a multi-method that compares a left and right object, where the objects are maps, and the comparison rules depend on a given type key. I want to avoid having to explicit pass left and right to all of the helper functions that will make up each method, so I was considering using dynamic bindings. Are dynamic bindings fairly fast, cause this would be in an inner loop? |
| 05:14 | Chousuke | I'm quite sure they're fairly fast. |
| 05:16 | Chousuke | But you'll have to test both approaches and see which one is faster. |
| 05:17 | djpowell | Yeah, I'll try dynamic binding. I suppose another alternative would be to use macros. Either some complicated macro that handles the limted nested expressions that I need to use; or a capturing macro. |
| 05:20 | Chousuke | remember to get rid of any reflection first, though, if there is any |
| 07:09 | bOR_ | hmmm. trying to set up chimp, but running into some newbieness. what is the shortcut for actually sending a s-exp to chimp? |
| 07:10 | bOR_ | I can type chimp and get a fine running chimp / clojure instance. |
| 07:10 | bOR_ | just don't know how to communicate with it from vim. |
| 07:10 | bOR_ | anyone experience with it? |
| 07:10 | Chousuke | maybe you should try gorilla instead? it's apparently supposed to replace chimp |
| 07:11 | bOR_ | that's my second option, but I wanted to get this to work.. if I understand correctly, chimp remains in a separate window |
| 07:11 | bOR_ | which I think I would favor above split windows. |
| 07:12 | bOR_ | <LocalLeader>eb |
| 07:13 | bOR_ | is a vim keybinding. just not familiar with what to type to execute it in vim. |
| 07:13 | bOR_ | and having some trouble finding it explained. |
| 07:16 | cgrand | rhickey: I like the split betwteen stream and Iter |
| 07:17 | rhickey | cgrand: cool, I'm glad somebody is looking :) |
| 07:17 | rhickey | the idea is to make streams relatively safe by serializing connections to them |
| 07:17 | cgrand | and I'm happy to see the callable replaced by a fn taking the eos token |
| 07:17 | rhickey | cgrand: yes, I'm anti-sentinel now |
| 07:18 | rhickey | cgrand: so the real question is whether or not to unify map/filter etc to take/return streams/seqs |
| 07:19 | rhickey | or have map + map-stream |
| 07:19 | rhickey | seq versions always being derivable from stream versions |
| 07:19 | rhickey | it begs the nil punning question |
| 07:20 | rhickey | before I made them safe I was decided for bifurcation, now I'm tempted |
| 07:21 | karmazilla | will streams be part of 1.0? |
| 07:22 | rhickey | karmazilla: they need not be if they don't entail breaking changes, what I'm talking about here is the key point |
| 07:23 | cgrand | when one wants nil punning, it has to call seq but, it's not different from having to call seq on a vector |
| 07:23 | cgrand | as long as rest returns a Seq |
| 07:24 | rhickey | cgrand: but its not nil punning anymore if one can't, say, use a seq function (like rest/filter) as a predicate |
| 07:25 | rhickey | sequence fns will no longer return ISeqs but just logical collection on which you can call seq |
| 07:26 | rhickey | e.g. you can now say (filter rest colls) to find all colls with more than one element |
| 07:27 | cgrand | yeah I didn't think of that :-( |
| 07:28 | rhickey | rest could still return a seq, with some new (more aseq) returning the logical collection, but that doesn't help the other sequence fns |
| 07:29 | rhickey | I've definitely written code which new I had already called seq once and therefore presumed ISeq/nil from all subsequent sequence fns |
| 07:29 | rhickey | knew |
| 07:31 | djpowell` | I'm implementing something with resultset-seq, that does some iterating of a few resultsets with a little lookahead. Is this something that would be stream-ified? Should I have any concerns with resultset-seq using seqs? |
| 07:33 | rhickey | djpowell: streams are meant to interoperate with seq code transparently, in particular, streams support a once-and-once only idempotent seq method. I imagine most sequence fns will be written using streams and consumed, at the end of the chain only, as seqs |
| 07:34 | rhickey | but if you wanted to, you could use streams directly where that made sense. Streams do support puchback |
| 07:34 | rhickey | still not as easy to reason about as persistent seqs |
| 07:35 | stuarthalloway | rhickey: what is "nil punning"? |
| 07:36 | stuarthalloway | Google returns the political works of John Greenleaf Whittier |
| 07:36 | djpowell | I don't quite understand the purpose of streams. Am I likely to run into any problems using the current resultset-seq as it isn't stream-based? |
| 07:37 | rhickey | stuarthalloway: it means leveraging the fact that sequence fns return either ISeq or nil, and using the conditional testability of nil - see (filter rest colls) above |
| 07:37 | stuarthalloway | rhickey: thanks -- is this a well-known term in some book I should have read? |
| 07:37 | rhickey | using sequence fns as predicates, saying (if aseq ...) |
| 07:38 | rhickey | stuarthalloway: it's a CL thing |
| 07:38 | stuarthalloway | it's no wonder CL never took off if their vocabulary is full of googlewhacks :-) |
| 07:41 | djpowell | is the problem with using seqs to handle streaming the risk of a closure capturing the head of a seq? |
| 07:43 | rhickey | for those who know enough CL and Scheme, this is funny: http://people.cs.uchicago.edu/~wiseman/humor/large-programs.html |
| 07:44 | rhickey | djpowell: not really, fully lazy seqs would help that too, but in some ways it's not a problem except with people's expectations that laziness == ephemerality |
| 07:45 | rhickey | streams are ephemeral, but closing over and otherwise aliasing them begs it's own issues |
| 07:47 | jacky | (defn mgroup [n coll] |
| 07:47 | jacky | (if (> n (count coll)) |
| 07:47 | jacky | (list coll) |
| 07:47 | jacky | (lazy-cons (take n coll) (recur n (nthrest coll n))))) |
| 07:47 | jacky | ;Mismatched argument count to recur, expected: 1 args, got: 2 |
| 07:48 | jacky | any idea why this could be happening? |
| 07:48 | rhickey | jacky: either you want lazy-cons or you want recur, not both |
| 07:49 | rhickey | lazy-cons (a macro) wraps both of the experessions in fns, so the recur in the rest targets that wrapping fn, not mgroup. If you want lazy, just call mgroup |
| 07:50 | rhickey | i.e. recur is for direct looping, the opposite of laziness |
| 07:50 | jacky | ah ok - got it. |
| 07:51 | rhickey | so, (lazy-cons (take n coll) (mgroup n (nthrest coll n))) |
| 07:51 | rhickey | or try partition :) |
| 07:51 | djpowell` | When I'm iterating over a seq, is it safe to assume that the portion of the seq that i've iterated past is ephemeral? |
| 07:52 | jacky | I changed the lazy-cons to a cons |
| 07:52 | rhickey | djpowell: not if you are still using it |
| 07:53 | jacky | Now, it says "Can only recur from tail position". I thought the function is at the tail position.. |
| 07:53 | rhickey | lazy seqs are only lazily created, after that they are persistent, and just like any other list, links get gc'ed only when you are not using them anymore |
| 07:53 | Chouser | if you have (cons foo bar), cons is in the tail position, not foo or bar |
| 07:54 | jacky | chouser: That is helpful. Is there a definition of what is tail? |
| 07:55 | djpowell` | rhickey: I think that should be fine then. I'm just map-ing and filtering through the seq, so i won't have any references to earlier elements. |
| 07:55 | rhickey | djpowell`: you should be fine, and don't worry about streams, they'll just slip in under the hood |
| 07:56 | jacky | I would assume that any recursive call with no further expressions to be evaluated is a tail call |
| 07:56 | rhickey | jacky: the expression whose return value is the return value of the calling function |
| 07:57 | Chouser | in a 'do' (or implicit 'do' like in 'fn', 'defn', etc.): (do a b c) only c is in the tail position, not a, not b, and nothing inside c |
| 07:58 | djpowell` | rhickey: cool. fyi: i'm using resultset-seq to collect together records from different database queries. it all seems really elegant, and runs pretty fast |
| 07:59 | jacky | rhickey: It took a while, but now I understand why cons is in tail and not foo or bar |
| 08:00 | jacky | thanks rhickey and chouser |
| 08:12 | clojurebot | svn rev 1221; wrap bean accessors in prepRet |
| 09:42 | Chouser | It's a bit impressive how much "Rich and the Contributers" does not sound like a band. |
| 09:43 | rhickey | :) |
| 09:43 | gnuvince | hahaha |
| 09:44 | rhickey | my last band was called Oh No!! |
| 09:44 | rhickey | long time ago |
| 09:44 | gnuvince | rhickey: you play music? |
| 09:45 | rhickey | gnuvince: don't all programmers? |
| 09:45 | gnuvince | rhickey: I know a few who don't. |
| 09:45 | gnuvince | Really? |
| 09:45 | rhickey | yup |
| 09:46 | gnuvince | How did you go from music composition to software development? |
| 09:46 | vy | This might be a stupid question, but... What's the reasoning behind using vectors instead of lists in function/method arguments, let bindings, etc.? |
| 09:47 | cooldude127 | vy: Helps distinguish function calls from other code |
| 09:47 | gnuvince | vy: it's visually distinctive |
| 09:48 | rhickey | play music -> have fun -> study music -> try to get record deal -> fail -> run recording studio -> buy computer for recording studio -> teach yourself programming -> switch to programming -> have fun |
| 09:48 | gnuvince | Wow, color me very impressed. |
| 09:48 | cooldude127 | Same here |
| 09:49 | vy | cooldude127: gnuvince: Just for eye-candiness? |
| 09:49 | clows | you missed the -> fail -> get cab license part ;) |
| 09:49 | cooldude127 | More for clarity |
| 09:49 | gnuvince | With the depth of your knowledge on CS topics, I would've imagined that you had a masters or PhD in CS |
| 09:50 | rhickey | went back for BS in CS |
| 09:51 | Chouser | my guess has been no PhD, based on how much Clojure is grounded in practicality. |
| 09:51 | cooldude127 | Currently doing a BS in CS |
| 09:52 | Chouser | If I could spend the time and effort to get a PhD, I might never have to write useful code again... |
| 09:52 | cooldude127 | Lol |
| 09:52 | gnuvince | Currently doing my calculus calsses |
| 09:53 | gnuvince | After that, hopefully a university degree in CS |
| 09:53 | gnuvince | I got a degree from what we call a cegep in Quebec, which is worse than worthless if you're looking for a programming job. |
| 09:53 | rhickey | vy: I think it is more than eye-candy. Since almost all data is not in lists and almost all lists are operations, it adds really enhances the understandability IMO |
| 09:54 | rhickey | ILC prelim program: http://www.international-lisp-conference.org/2009/index |
| 09:55 | gnuvince | Speaking of which... |
| 09:56 | gnuvince | http://lispy.wordpress.com/2008/10/25/lisp50-notes-part-vi-the-future-of-lisp/#comment-2514 |
| 09:58 | rhickey | I guarantee the full day tutorial will be the most in-depth talks I've given on Clojure |
| 09:58 | gnuvince | Awesome |
| 09:58 | gnuvince | Hopefully it's screencasted |
| 09:58 | Chouser | I wonder if it's cheaper to only go for the first day. |
| 09:59 | rhickey | Chouser: they've done per diem pricing in the past |
| 09:59 | Lau_of_DK | rhickey: When is your tour of Northern Europe scheduled for ? |
| 10:00 | rhickey | Lau_of_DK: QCon London is all that's on the schedule |
| 10:01 | Lau_of_DK | London is very cold and misty - Have you considered Copenhagen ? |
| 10:07 | cooldude127 | so i'm debating in my date library whether to have blank out fields that aren't specified. like if you only specify year, month, and day, do you want time to be the current time or to be 00:00:00 ? |
| 10:07 | Chouser | 0 |
| 10:07 | cooldude127 | s/have blank/blank |
| 10:08 | gnuvince | 00:00:00 |
| 10:08 | cooldude127 | right now, it gives the current date, such that calling (date) with no args gives the current date. should i have a separate function called (today) for that? |
| 10:09 | te | Hello all |
| 10:09 | Chouser | does the underlying Java class have the concept of a blank or invalid date? |
| 10:09 | te | <-total clojure noob |
| 10:09 | Chouser | te: hi, welcome! |
| 10:09 | te | Does anyone have any good tips on learning Clojure? |
| 10:10 | te | I'm very interested -- but I don't know a lick of java or lisp |
| 10:10 | rhickey | Interesting quote: "Clojure is Python for functional programmers" - http://neopythonic.blogspot.com/2008/11/scala.html?showComment=1230447780000#c9087235066224967849 |
| 10:10 | cooldude127 | Chouser: by default, it is the current date, but the Calendar class has a clear() method to blank it out |
| 10:10 | te | I've looked at Haskell and Lisp in the past, but Clojure seems more alongm my lines |
| 10:10 | te | along* |
| 10:12 | rhickey | te: I realize it costs money, but I don't know of a more from-scratch tutorial than: http://www.pragprog.com/titles/shcloj/programming-clojure |
| 10:12 | te | I'm a big fan of pragprog's stuff -- I believe I have a coupon to use on there |
| 10:12 | cooldude127 | so i should have dates, by default, only contain the data the user passes |
| 10:12 | cooldude127 | that sounds right, it's least surprising |
| 10:13 | Chouser | cooldude127: I think that's right |
| 10:13 | cooldude127 | In that case, I think I'll have two other functions, (today) and (now) that give the current date and date/time |
| 10:15 | Chouser | that sounds right too, though providing those as flags to the regular date ctor fn might work too |
| 10:15 | cooldude127 | Chouser: that function has so many args already, it seems more clear to just do a separate function |
| 10:17 | Chouser | ok |
| 10:18 | cooldude127 | actually, is it that important to have one for date and another for date/time? |
| 10:18 | Chousuke | hmm. |
| 10:21 | cooldude127 | nvm i just went ahead and made both. all today does is dissoc :hour :minute and :second from now |
| 10:30 | cooldude127 | ok now anyone interested, tell me what's wrong or missing from this date library: http://gist.github.com/49656 |
| 10:33 | gnuvince | cooldude127: time deltas |
| 10:34 | cooldude127 | gnuvince: as in durations? |
| 10:34 | gnuvince | Like (add-time today (delta {:days 12})) |
| 10:35 | gnuvince | So you get today's date plus 12 days (accounting for months, years, etc.) |
| 10:36 | cooldude127 | gnuvince: ok |
| 10:36 | cooldude127 | i'm not even sure the delta function is necessary |
| 10:36 | cooldude127 | just use {:days 12} as a delta |
| 10:36 | gnuvince | Possibly |
| 10:37 | Chouser | deltas are almost but not quite entirely unlike dates |
| 10:37 | cooldude127 | Chouser: that was really confusing |
| 10:37 | Chouser | :days, :hours, :minutes, :seconds, but not :months or :years |
| 10:38 | cooldude127 | why not months or years? |
| 10:38 | Chouser | because some months are different sizes than others, same for years. |
| 10:39 | cooldude127 | oh |
| 10:39 | karmazilla | Joda Time destinguishes between "periods" and "intervals"... Periods are like 1 month, and intervals are some exact amount of millis |
| 10:39 | cooldude127 | ah this is annoying. time is stupid |
| 10:39 | Chouser | a date is such a messy piece of data |
| 10:40 | cooldude127 | it very much is |
| 10:41 | cooldude127 | intervals in joda time have a start and end time |
| 10:41 | cooldude127 | they can convert to periods and durations |
| 10:42 | cooldude127 | i'm starting to think i should add some kind of key to distinguish instants, deltas, intervals, whatever, and use some multimethods |
| 10:44 | cooldude127 | ok wtf is this hierarchies stuff? i'm very confused |
| 10:52 | Chouser | ,(derive ::Period ::Time) |
| 10:52 | clojurebot | nil |
| 10:52 | Chouser | ,(isa? ::Period ::Time) |
| 10:52 | clojurebot | true |
| 10:54 | cooldude127 | brb |
| 11:02 | cooldude127 | wow vending machines are a ripoff |
| 11:08 | cooldude127 | so should i be using like ::date instead of :date for types? |
| 11:09 | Chousuke | cooldude127: :date if you actually expose them to the user as selectors. |
| 11:09 | rhickey | cooldude127: or `Date (note syntax-quote) |
| 11:09 | rhickey | ::Date |
| 11:09 | cooldude127 | i'm using them as type specifiers, nothing more, does that help? |
| 11:10 | cooldude127 | also, is ::Date or ::date preferred? |
| 11:10 | Chousuke | for multimethods? yeah, double-colon is probably better in that case. |
| 11:10 | cooldude127 | yeah alright |
| 11:11 | rhickey | I'd prefer to see upper-case D |
| 11:11 | cooldude127 | rhickey: any reason? |
| 11:11 | rhickey | looks like a type name to me |
| 11:11 | cooldude127 | ok |
| 11:11 | cooldude127 | rhickey: perhaps the docs could be fixed to use uppercase everywhere |
| 11:12 | cooldude127 | it's mixed at the moment |
| 11:27 | cooldude127 | ok this hierarchies stuff is actually kinda fun |
| 11:27 | cooldude127 | :) |
| 11:30 | cooldude127 | ok so now i have two different types: Date and Time, which both derive from Instant |
| 11:31 | cooldude127 | Date has year month and day, as well as time zone |
| 11:31 | danlei` | hm ... i'd suggest you start with 1-2-3-5 patterns, which is a common idiom trane himself used quite a lot. also, keep in mind, that in spite of the rapid changes there are only three tonal centers (b, eb, and g). |
| 11:31 | cooldude127 | Time has all that plus hours minutes and seconds |
| 11:31 | danlei` | oops |
| 11:31 | cooldude127 | c-c-c-combo breaker |
| 11:31 | cooldude127 | sorry |
| 11:39 | cooldude127 | where does the docstring for a multimethod go? |
| 11:44 | Chouser | (defmulti #^{:doc "does foo things"} foo ::Type) |
| 11:45 | rhickey | initial docs for streams: http://clojure.org/streams |
| 11:45 | rhickey | feedback welcome |
| 11:46 | cooldude127 | sweet |
| 11:46 | Chouser | streams are going to happen independently of the scope form? |
| 11:47 | rhickey | Chouser: yes, scope likely sooner as it works for lazy-seqs too |
| 11:47 | cooldude127 | nice to see that we are condemning straight use of generators. |
| 11:47 | rhickey | cooldude127: right, that's been the challenge here, making something that won't ruin Clojure's approach to things |
| 11:48 | cooldude127 | rhickey: i can imagine that was difficult |
| 11:50 | Chouser | anything in the language preventing the aliasing of an Iter? |
| 11:51 | rhickey | Chouser: no, can't be, just the usage pattern of take/return streams |
| 11:51 | Chouser | ok |
| 11:51 | cooldude127 | what exactly differentiates streams and lazy seqs? |
| 11:52 | Chouser | when you call 'rest' on a seq, you get a whole new object. 'next!' on an Iter (on a Stream) changes the existing objects to the new state. |
| 11:53 | cooldude127 | oh |
| 11:53 | rhickey | Chouser: this should be the kicker for accidental iter leakage: |
| 11:53 | rhickey | user=> (seq (stream-iter [1 2 3])) |
| 11:53 | rhickey | java.lang.IllegalArgumentException: Don't know how to create ISeq from: Iter (NO_SOURCE_FILE:0) |
| 11:53 | Chouser | ok. |
| 11:54 | rhickey | user=> (seq (stream [1 2 3])) |
| 11:54 | rhickey | (1 2 3) |
| 11:54 | Chouser | Will 'scope' be useful to make sure my Iter is detached before my function is done? |
| 11:55 | Chouser | hm, or is the dynamic scope of 'scope' inappropriate, and I should just be careful to use 'detach!' explicitly. |
| 11:55 | rhickey | Chouser: you could use it for that, but I don't see that being the common case, detaching is just for chainable versions of things like take |
| 11:55 | rhickey | which would have an explicit call to detach in it |
| 11:56 | rhickey | scope would be used to close your file for line-stream/seq |
| 11:57 | rhickey | the vast majority of fns will keep their iter on one stream, embedding it in the generator of another, a la map/filter, or completely use it and toss it like reduce |
| 11:58 | rhickey | less common would be chainable-take, detaching before returning |
| 11:58 | Chouser | this is completely separate from LFE and the Haskell slides I was trying to read? |
| 11:59 | rhickey | Chouser: yes, this is a pull model |
| 11:59 | rhickey | LFE is inversion of control |
| 11:59 | Chouser | you were interested in LFE primarily for resource management, which you're now planning to handle with 'scope' instead |
| 11:59 | drewr | Where does eos come from? |
| 12:00 | gnuvince | drewr: end of sequence |
| 12:00 | rhickey | Chouser: LFE offered resource management and safety, I think scope + safe streams is easier, and definitely faster |
| 12:00 | drewr | Or, what would an eos typically be? A function that you want to dispatch when you're done? |
| 12:00 | gnuvince | drewr: nil |
| 12:01 | gnuvince | ,(cons 3 nil) |
| 12:01 | clojurebot | (3) |
| 12:01 | cgrand | drewr: (Object.) or (gensym) |
| 12:01 | rhickey | drewr: eos is just a sentinel value not going to be present in the stream, usually a one-off Object, see reduce* in the docs |
| 12:01 | rhickey | but not a hardwired canonic sentinel |
| 12:02 | Chouser | safe-streams are useful even though we have seqs because they are faster and don't cache? |
| 12:02 | rhickey | safe streams allow for an allocation-free pipeline |
| 12:02 | rhickey | :) |
| 12:02 | Chouser | mmm... |
| 12:02 | rhickey | also fully lazy |
| 12:03 | Chouser | no new object per iteration |
| 12:03 | rhickey | without allocation, whereas fully lazy seqs will require a Delay alloc |
| 12:03 | rhickey | no object(s) per iteration stage |
| 12:04 | gnuvince | Is that following the blog post about laziness in CLojure? |
| 12:04 | Chouser | because the things in the stream are not ISeq objects, but just the value objects. |
| 12:04 | rhickey | currently 2 per stage (the lazy-cons and the first/rest fn) |
| 12:04 | rhickey | gnuvince: this work has been going on long before that |
| 12:05 | gnuvince | rhickey: okay |
| 12:05 | rhickey | Chouser: right, I'm not counting the values |
| 12:05 | rhickey | a call to pull on a stream just results in a string of calls |
| 12:06 | rhickey | add stages and the difference really adds up, rarely less than 2x faster |
| 12:07 | rhickey | Of course, if you have any significant computation per step that dominates, so the real difference here is for trivial stages |
| 12:08 | rhickey | but strapping a seq on the end of a stream chain is beautiful, because that's where you really want the persistence, and you only get a single seq chain |
| 12:14 | Chouser | ok, sounds great. :-) |
| 12:15 | rhickey | So the final questions are, is this safe enough to unify with seq versions?, and if so, what's the cost of the requisite (breaking) removal of nil-punning |
| 12:19 | rhickey | It seems sad to move away from the canonic recursive versions of things like filter to these imperative ones, OTOH, if people avoid using higher-order fns like filter for perf... |
| 12:21 | Chousuke | better encapsulate it at the lower level where it's not seen :) |
| 12:24 | cgrand | stupid idea of the day: map on a coll/seq yields a seq, map on a stream a stream |
| 12:25 | rhickey | cgrand: that drops serious perf enhancements of map on coll -> stream |
| 12:26 | rhickey | also, I think that the return value should be universal |
| 12:26 | rhickey | i.e. minimally defined as a logical collection |
| 12:26 | Chouser | which is what you'd want primarily as the first step of a chain, where the seq would be attached at a later link? |
| 12:26 | rhickey | on which seq and stream will work |
| 12:27 | rhickey | Chouser: right, by default sequence fns will call stream on their args |
| 12:29 | rhickey | the problem with bifircation, either explicitly with different fn names or implicitly by arg type, is the lego-like quality of Clojure is diminished |
| 12:29 | rhickey | bifurcation |
| 12:30 | rhickey | to unify you have to drop nil punning lest someone change a distant source from seq to stream and break your down-chain pun |
| 12:31 | Chouser | I don't know about "safe enough" but I still think that the loss of nil punning will cause significant but short-term pain |
| 12:31 | Chouser | I don't think it will be much missed 4 months after its gone. |
| 12:31 | rhickey | Chouser: no doubt, quite a bit for me personally :) |
| 12:31 | cooldude127 | what's nil punning? |
| 12:32 | Chouser | cooldude127: relying on the assumption that an empty seq evaluates as false |
| 12:32 | cooldude127 | oh |
| 12:33 | rhickey | only ways to mitigate nil punning are: keep rest as a fn of seq-->seq/nil, add a more fn of seq->logical-collection |
| 12:33 | Chouser | (if (rest foo) (recur bar) (all done)) |
| 12:33 | Chouser | ^ would have to become |
| 12:33 | Chouser | (if (seq (rest foo)) (recur bar) (all done)) |
| 12:33 | rhickey | or add a third condition to truth logic |
| 12:33 | rhickey | emptiness |
| 12:34 | rhickey | er, not quite, end-ness |
| 12:34 | Chouser | I don't think emptiness == false is worth it. That way lies madness. |
| 12:34 | rhickey | Chouser: I misspoke - end-ness, not emptiness |
| 12:35 | rhickey | but possibly hard to discriminate, and a big perf loss, not seriously being considered |
| 12:36 | cgrand | what is -end-ness? |
| 12:36 | Chouser | but once a couple kinds of objects have their own personal mechanism for falseness, everyone will want to do it. |
| 12:36 | rhickey | cgrand: would only apply to seqs and streams, means would produce a nil seq |
| 12:37 | cgrand | ah ok |
| 12:38 | rhickey | streams have a pushback buffer to allow for this (and other) uses |
| 12:38 | technomancy | cooldude127: how's that date stuff coming? |
| 12:38 | rhickey | since asking that question of a stream will pull one item |
| 12:38 | cooldude127 | technomancy: pretty well, i'll update the gist with what i have |
| 12:39 | cooldude127 | technomancy: updated http://gist.github.com/49656 |
| 12:39 | technomancy | nice |
| 12:40 | cooldude127 | technomancy: i plan to add more types like deltas and intervals |
| 12:40 | rhickey | the problem with end-ness is that, in order to be fair, it would involve an instanceof check |
| 12:40 | rhickey | not merely a type == AStream check |
| 12:41 | rhickey | so that the purely functional camp could get a delay-seq |
| 12:41 | rhickey | and write fully lazy seqs without using streams |
| 12:47 | technomancy | every time I go back to ruby I expect it to keep the structure intact around my editing operations |
| 12:49 | cooldude127 | lol |
| 12:49 | cooldude127 | i love paredit |
| 12:54 | technomancy | gist is nice, but I still prefer lisppaste for clojure and elisp code |
| 12:54 | technomancy | though they've been having downtime issues recently |
| 12:55 | duck1123 | cooldude127: it's not as cool as you might hope. It still needs work |
| 12:55 | cooldude127 | duck1123: i'm about to find out |
| 12:55 | technomancy | duck1123: you mean forking and such? |
| 12:56 | cooldude127 | i already see a problem |
| 12:56 | duck1123 | I was just hoping it would do a few things, and it just didn't deliver. I only played with it for a little bit |
| 12:56 | cooldude127 | gist.el only supports creating new pastes |
| 12:56 | cooldude127 | no editing |
| 12:56 | technomancy | in my experience it's better than your average paste mode, but yeah, it doesn't expose a lot of the things that make gist cool. |
| 12:57 | technomancy | and lisppaste's syntax highlighting is hot stuff. |
| 12:57 | duck1123 | that was my main complaint. I want to pull an old gist, edit, c-c C-c and be done with it |
| 12:57 | cooldude127 | technomancy: what with the parentheses highlighting? |
| 12:57 | cooldude127 | duck1123: yeah that would be very cool |
| 12:58 | technomancy | duck1123: shouldn't be too hard to add if you really want it |
| 12:58 | cooldude127 | even if we had to have like a ;; -*- gist: 48374 -*- at the top (i don't know if that would actually work) |
| 12:59 | technomancy | duck1123: you better watch out; I'm in a delegating mood these days. yesterday I told cooldude127 to go write a date wrapper for clojure-contrib |
| 12:59 | technomancy | (and to my surprise he actually did) |
| 12:59 | cooldude127 | lol |
| 12:59 | cooldude127 | I'M BORED |
| 12:59 | duck1123 | I saw that, I was without IRC access yesterday, so I just read the logs |
| 12:59 | cooldude127 | haha |
| 13:00 | duck1123 | cooldude127: does your wrapper do xsd:dateTime? |
| 13:00 | technomancy | cooldude127: you hear that? you think *you're* bored; duck1123 reads IRC logs in his spare time. =) |
| 13:00 | cooldude127 | duck1123: considering i don't have a clue what you mean, i'm going to say no |
| 13:00 | cooldude127 | technomancy: lol |
| 13:01 | duck1123 | xsd:dateTime is like 2009-01-21T12:59:59.000-05:00 |
| 13:01 | technomancy | duck1123: so you mean parsing it out from a string? |
| 13:01 | cooldude127 | duck1123: it doesn't do formatting or parsing yet |
| 13:02 | cooldude127 | but i think i might go ahead right now and tackle formatting |
| 13:02 | duck1123 | it's suprisingly difficult to do with Java's standard date formatting library |
| 13:02 | cooldude127 | why? |
| 13:02 | cooldude127 | cuz that's my backend :) |
| 13:02 | duck1123 | the only real problem was the -05:00 bit, I had to resort to regexp to fix that part |
| 13:03 | cooldude127 | shit |
| 13:04 | duck1123 | If you can deal with -0500 it's fine, but if you need that colon in there... |
| 13:05 | cooldude127 | i think i'm gonna use a multimethod for this. so basically you can define a function for predefined formats, or pass in a string |
| 13:05 | Chouser | rhickey: fwiw, I don't think either of your ideas for mitigating nil-punning pay for themselves. Just yank that band-aid right off. |
| 13:06 | Chouser | I'll stick around and help answer the "this code used to work but now its an infinite loop" questions that'll come up a few times a day for a couple months. :-) |
| 13:07 | Chouser | but that leaves the "sufficiently safe" part of the question. In what way are merged seq/stream functions potentially dangerous? |
| 13:10 | rhickey | Chouser: ok, thanks for the help (then and now) :) |
| 13:10 | cooldude127 | wtf java? DateFormat itself has only three formats to choose from, but the one you give a string with a format is called SimpleDateFormat? |
| 13:10 | cooldude127 | i think we have this backwards |
| 13:11 | rhickey | Chouser: I don't think the streams as I've laid them out are dangerous, they sort of let you work with stateful computational segments in a functional manner |
| 13:12 | cooldude127 | do multimethods work such that i can specify a method as the default for just one argument? basically only specialize one if i feel like it? |
| 13:13 | rhickey | the iters themselves are thread-safe, and streams thread-safe-ize any generator |
| 13:13 | Chouser | cooldude127: your dispatch function has to take all the args, but it can ignore all but the first one if it wants to. |
| 13:14 | cooldude127 | Chouser: but i want to do it on a per-method basis |
| 13:15 | Chouser | there's no example of how to create a generator at http://clojure.org/streams, right? I'm not overlooking it? |
| 13:15 | cooldude127 | say, have (defmethod blah [:default ::something]) |
| 13:15 | cooldude127 | and have that work as expected |
| 13:15 | rhickey | so you could, in a computational step, share an iter between worker threads |
| 13:17 | Chouser | cooldude127: I don't think so. |
| 13:17 | cooldude127 | dammit |
| 13:17 | Chouser | cooldude127: I think there was an item on the old todo list for that, but I don't see it on the issues page. |
| 13:17 | rhickey | Chouser: (fn [eos] ...) in filter* and map* are generators |
| 13:18 | cooldude127 | Chouser: it's probably not that big a deal, i think i can do without specializing one of them at all for the sake of simplicity |
| 13:18 | technomancy | cooldude127: "Simple" is Javanese for "backwards" |
| 13:18 | cooldude127 | lol |
| 13:18 | cooldude127 | technomancy: i was gonna have formatting functions specialize on both the date type and the format to use, but i'm gonna just do the format |
| 13:19 | Chousuke | no, actually, simple means it only has one method that does everything. |
| 13:19 | technomancy | ah. well 1 is certainly simpler than "many". |
| 13:21 | Chouser | cooldude127: what are the possible (or likely) types that your second arg was going to take? |
| 13:22 | cooldude127 | Chouser: the dates? most of the time it wouldn't matter, but it could be ::Date or ::Time |
| 13:23 | cooldude127 | Chouser: doesn't matter, i think it's better with just one |
| 13:23 | Chouser | cooldude127: you can have both ::Date and ::Time derive from ::Object or something, and use that instead of :default. |
| 13:23 | Chouser | oh, ok. |
| 13:23 | cooldude127 | they actually do derive from the same thing, i guess i just wanted something more intuitive than [::Instant :short] |
| 13:24 | rhickey | A generator is literally a fn that takes an eos and returns it or something else |
| 13:24 | Chouser | rhickey: ok, I see that now. |
| 13:24 | rhickey | I should qualify that, once it returns the eos it should always do so |
| 13:25 | Chouser | so for some spots in my program I might be trying to choose between writing a generator vs. a fn that returns a lazy-cons |
| 13:25 | Chouser | with merged stream/seq fns, the rest of my program might not care if I change my mind later. |
| 13:26 | rhickey | Chouser: the generator must be stateful, but if your data source is too (e.g. a file/queue etc) streams are best fit |
| 13:26 | rhickey | yes, unified model would make the choice transparent |
| 13:27 | Chouser | filter* and map* store their state in the stream created by stream-iter? |
| 13:27 | cooldude127 | actually, looking at the DateFormat API, it looks like two arguments specialized is the way to go, as java distinguishes formatting dates and times |
| 13:27 | rhickey | bifurcated model you might say (defstream myfun ...) and get myfun and myfun* |
| 13:28 | Chouser | but the body of myfun would be the generator. |
| 13:28 | rhickey | Chouser: filter and map have no state of their own, but yes, their source iter does |
| 13:28 | technomancy | I'm seeing this pattern a fair amount where I want to move an element from one ref/seq to another. is there a better way to abstract it? (http://gist.github.com/50091) |
| 13:29 | rhickey | Chouser: take/drop might have an atom around their counter |
| 13:29 | Chouser | oh, is 'range' in those examples returning a seq or a stream? |
| 13:30 | rhickey | Chouser: range supports stream directly, but stream already converts colls and seqs |
| 13:31 | Chouser | technomancy: were you asking the other day about treating seqs of maps as a sort of database, or was that someone else? |
| 13:31 | rhickey | most of the work for using just about anything as a stream source is done |
| 13:32 | technomancy | Chouser: I was asking about that a while ago, yeah. sounds like Lau's project does that? |
| 13:32 | Chouser | so stream fns make streams from seqs, and seq fns make seqs from streams. |
| 13:32 | rhickey | Chouser: right, that's all transparent |
| 13:32 | Chouser | technomancy: oh, I didn't mean db in the SQL sense. |
| 13:33 | Chouser | technomancy: just that I've not seen many attempts to use a seq of maps like that, wanted to make sure this was the same app. :-) |
| 13:33 | Chouser | technomancy: and asking was wiser than trusting my memory and easier than checking the logs. |
| 13:33 | technomancy | Chouser: ah, must have been someone else talking about it here. But I am interested in the idea provided Terracotta can provide persistence. |
| 13:34 | Chouser | rhickey: so if merged, the library fns would return the same type as they're given? |
| 13:34 | rhickey | Chouser: (stream coll/stream/seq/fn) all work |
| 13:34 | rhickey | Chouser: if merged the actual type they return would depend on the implementation, a stream implementation would return a stream, a seq one a seq |
| 13:35 | rhickey | consumer wouldn't care, but would probably prefer a stream impl for speed |
| 13:35 | Chouser | a "stream implementation" of what? just one fn, right? |
| 13:35 | technomancy | Chouser: what do you mean you've not seen many attempts to use a seq of maps as a data base? seems like the most natural thing in the world to me. |
| 13:36 | Chouser | technomancy: using 'remove' like that will remove all matching maps from the seq, right? |
| 13:36 | Chouser | technomancy: so why not use a set of maps instead of a seq? |
| 13:36 | rhickey | Chouser: yes, a fn like map/filter |
| 13:36 | technomancy | Chouser: interesting. In this case I have a guarantee of uniqueness enforced elsewhere, but it definitely wouldn't hurt to use sets here; you're right. |
| 13:37 | rhickey | amazingly: |
| 13:37 | technomancy | sets are underrated. |
| 13:37 | rhickey | (reduce* + 0 (seq (map* inc (seq (filter* even? (range 1000000)))))) |
| 13:37 | rhickey | is still faster than: |
| 13:37 | rhickey | (reduce + 0 (map inc (filter even? (range 1000000)))) |
| 13:37 | Chouser | technomancy: if (:items @*current-room*) were a set of maps, clojure.set gives you a bunch of functions for working this it. |
| 13:38 | rhickey | and without the intervening seq calls is twice as fast |
| 13:38 | technomancy | Chouser: oh, I see. I was looking for something generalized for any seq. |
| 13:39 | Chouser | is there really no way to use different words for map or map (the fn and the collection, respectively)? |
| 13:39 | technomancy | heh |
| 13:39 | technomancy | smalltalk calls map "collect" |
| 13:39 | technomancy | (the function) |
| 13:39 | technomancy | or you could call the seq a hash-map |
| 13:40 | Chouser | rhickey: that is amazing. But I'm still missing something. if 'map' is the one fn for consuming seqs and streams, will it always return a stream? |
| 13:40 | rhickey | Chouser: yes |
| 13:40 | technomancy | Chouser: actually... I don't think I should use a set there now since in the future you could have multiple instances of an item in a room. |
| 13:40 | Chouser | rhickey: oh! I see, that was the point of your example. all caught up now. :-) |
| 13:40 | technomancy | so I think I will write my own move-between-seqs function |
| 13:40 | rhickey | Chouser: most of the standard seq fns would in fact be stream-returning |
| 13:40 | Chouser | technomancy: but then you can't use 'remove' like that. |
| 13:41 | Cark | rhikey : i'm a bit late on the discussion, removing nil punning is imho a step backward from clojure's practicality |
| 13:41 | technomancy | Chouser: correct; that will need to be fixed. |
| 13:41 | Cark | rhickey : though i understand why you would want that |
| 13:42 | rhickey | Cark: If I could have it all I would :) |
| 13:42 | rhickey | but I still can't figure out how - design == tradeoffs :( |
| 13:42 | Cark | yes |
| 13:42 | rhickey | Cark: I like nil punning as much as anyone does |
| 13:43 | durka42 | i don't think nil? is that much of a hassle |
| 13:43 | Cark | i'll go light a candle on my dead code then =) |
| 13:43 | Chouser | after fixing the existing code that breaks, though, it's really not any mental burden, and a pretty light syntactic one |
| 13:43 | Chouser | durka42: seq |
| 13:44 | Chouser | you already know you're working with potentially some kind of collection but are using it in a boolean context. |
| 13:44 | durka42 | oh, you can't use nil? even |
| 13:44 | durka42 | right |
| 13:44 | technomancy | I hadn't spotted that, but it definitely is needed. |
| 13:44 | rhickey | Chouser: only CLers will miss it because they already had it there |
| 13:44 | danlei | oh |
| 13:45 | LordOfTheNoobs | Is there any way to tell during macro expansion whether a variable is set yet or not without triggering a read error? |
| 13:45 | Chouser | you already have to make sure that it's not just a collection (since empty collections are true), and instead was returned by something that made a seq for you. |
| 13:45 | danlei | (if nil 1 2) will be 1? |
| 13:45 | Chouser | danlei: no |
| 13:45 | durka42 | no, but (if [] 1 2) will be |
| 13:45 | Chouser | durka42: already is! |
| 13:45 | danlei | sorry, i'm late to the discussion |
| 13:45 | durka42 | bah |
| 13:45 | danlei | hm .. |
| 13:45 | durka42 | i thought i understood nil punning |
| 13:46 | rhickey | Chouser: true, but all seq fns did that (returned a seq), plus there is the non-local test, using seq fns as predicates |
| 13:46 | Chouser | (if (rest [9]) 1 2) is currently 2, but without nil punning would be 1 |
| 13:46 | durka42 | isn't calling seq going to be inefficient, since if the collection isn't empty it's going to walk the whole seq? |
| 13:46 | danlei | thanks, chouser |
| 13:47 | rhickey | durka42: no, seq is fast O(1) |
| 13:47 | Chouser | I've already spent the time to check and make sure that when destructing like [a b & c :as all] that 'all' doesn't go through 'seq'. How useful is it to know that, and exploit that knowledge? |
| 13:48 | rhickey | Chouser: the reason not to go through seq there is not to transform the type of all |
| 13:48 | Chouser | rhickey: right! but it wouldn't be a rediculous design for it have gone through seq, so I had to check. |
| 13:49 | Chouser | my point is just that you already have to think carefully before relying on nil punning, so never being able to rely on it isn't going to be much of a mental burden for new code. |
| 13:50 | Chouser | the syntactic burden of (seq x) is pretty minimal in most of the places where it'll be used. |
| 13:50 | rhickey | Chouser: true, not a burden, just a lost convenience |
| 13:51 | Chousuke | I doubt it'd alienate anyone from clojure either. :/ |
| 13:51 | LordOfTheNoobs | nevermind. (ns-resolve namespace symbol) will do, i think. |
| 13:51 | rhickey | When not a funny poem, this is also a cautionary tale; http://people.cs.uchicago.edu/~wiseman/humor/large-programs.html |
| 13:51 | Chouser | LordOfTheNoobs: sorry, you asked at a busy moment |
| 13:52 | Chouser | LordOfTheNoobs: you have a symbol. you saw 'defonce' and 'resolve'? |
| 13:52 | durka42 | hehe, hackstincts |
| 13:52 | technomancy | oh cool, the clojure-mode.el guy is no longer MIA. =) |
| 13:53 | cooldude127 | OH SHIT, clojure doesn't do isa? recursively through vectors |
| 13:53 | cooldude127 | wait, i can make this work |
| 13:53 | Lau_of_DK | rhickey: What is it you like so much about that poem? :) |
| 13:53 | technomancy | Lau_of_DK: so your keyword additions should make it upstream soon. |
| 13:53 | rhickey | Lau_of_DK: besides the fact that it rhymes? |
| 13:53 | Lau_of_DK | Yea - besides that |
| 13:54 | Chouser | cooldude127: are you sure? |
| 13:54 | cooldude127 | yeah, turns out the case where i want it to do that is also the overall default case |
| 13:54 | LordOfTheNoobs | I had not seen defonce. It may be useful. Thank you Chouser. |
| 13:54 | rhickey | it touches on a difference in approach between Scheme/T programmers and CLers, re: purity and pragmatism |
| 13:55 | technomancy | what's t3? |
| 13:55 | Chouser | ,(isa? [::Period ::Time] [::Time ::Time]) |
| 13:55 | clojurebot | true |
| 13:55 | Lau_of_DK | Oh I see :) I guess youre right, but we might have to counter with a clojure-rhyme to make it really obvious |
| 13:55 | rhickey | technomancy: T was a Scheme-like lisp dialect from Yale |
| 13:56 | technomancy | ah |
| 13:56 | rhickey | T3 the latest version |
| 13:56 | rhickey | Note this is 20+ years old and we're still talking about the same things, sigh |
| 13:57 | Lau_of_DK | hehe, we were all waitin for you Rich :) |
| 13:57 | Chouser | that poem's moral might be more obvious to me if I could make sense of the code. |
| 13:57 | Lau_of_DK | Why did you have to waste all those years playing music? |
| 13:57 | Chouser | heh |
| 13:57 | Chousuke | oh, heh |
| 13:57 | Chousuke | that posting is older than I am :( |
| 13:57 | technomancy | Chouser: CL is weeeird |
| 13:57 | technomancy | all trying to save on bytes by picking short function names |
| 13:58 | rhickey | Chouser: it is just highlighting the loss of nil punning in a language that not only had no nil pun, but no nil/false, and no anything-else/truth |
| 13:58 | rhickey | and the corresponding growth of the code, with no increase in clarity |
| 13:58 | cooldude127 | who wants hot date formatting action? http://gist.github.com/49656 |
| 13:58 | Chouser | I'm guessing key and a-list are formal args to the fn being defined, and assq is a builtin fn |
| 13:59 | Chousuke | I wonder what it does though |
| 13:59 | Chouser | => looks like infix, which is confounding. |
| 13:59 | danlei | seems like assoc |
| 13:59 | danlei | a lookup |
| 13:59 | danlei | mean cl's assoc |
| 14:00 | durka42 | Chouser: clojure has :>> or something in condp, right? |
| 14:00 | Chousuke | associative-list-query? :p |
| 14:00 | rhickey | http://www.delorie.com/gnu/docs/elisp-manual-21/elisp_89.html |
| 14:00 | Chouser | durka42: yes. also confounding. :-) |
| 14:00 | Lau_of_DK | durka42: Right - We still dont know who put that smiley in there :( |
| 14:00 | danlei | (assoc 'a '((a . 2))) -> (a . 2) |
| 14:00 | cooldude127 | duck1123: http://gist.github.com/49656 how's this for formatting date? i haven't done the format you were talking about, but it could be done with another defmethod. this way there is a uniform way to add formats |
| 14:01 | technomancy | whenever I read too much CL code that tries to save bytes or do other things that made sense in the 80s I always feel like I'm in that music video "Take On Me" |
| 14:01 | cooldude127 | technomancy: lol |
| 14:02 | technomancy | (I visualize filesystem functions that support platforms that were on their way out when I was born as big hair.) |
| 14:02 | technomancy | and case-insensitivity as synths |
| 14:02 | durka42 | well it's good we have advanced past the dark time when so many were insensitive to case |
| 14:03 | Chouser | ah, assq is find and cdr (in this case) is val |
| 14:03 | technomancy | cdr is rest |
| 14:03 | danlei | yes |
| 14:03 | Lau_of_DK | Chouser: You never lived in the whole car/cdr world? |
| 14:03 | Chouser | yes, I did actually know that. |
| 14:04 | danlei | (cer (assoc 'a '((a . 1) (b . 2))) 1 |
| 14:04 | danlei | *cdr |
| 14:04 | Chouser | but please don't ask me to expand cdaddr |
| 14:05 | rhickey | an a-list implies a list of pairs |
| 14:05 | Lau_of_DK | Its just a name convention that simplifies alot of stuff Chous'. Instead of parsing seqs to get specific values, you can just (caddardrrarcar seq) and get exactly what you want |
| 14:05 | rhickey | assoc/assq returns the pair with that key, but he only wants the val, thus cdr, second part of the pair |
| 14:06 | rhickey | but when not found, assoc/assq returns nil, and in T, (cdr nil) fails |
| 14:07 | rhickey | so he tries calling cdr conditionally, but T cond fails if no match |
| 14:07 | Chouser | yep, i'm all good up to the second-to-last version |
| 14:07 | Lau_of_DK | rhickey: I didnt really understand - was there no way to obtain those 2x 4x speedgains and integrate streams without giving up nil-punning? |
| 14:07 | duck1123 | cooldude127: looks pretty good. I look forward to replacing my date formatting code with something a bit prettier. |
| 14:08 | rhickey | so he tries to add an else, but cond still failed since nil was not false |
| 14:08 | cooldude127 | duck1123: i might restructure the types so that ::Time is just a time, and have ::DateTime be what ::Time is now |
| 14:08 | rhickey | so he has to capture the value, and test for nil-ness |
| 14:09 | Chouser | fantastic. |
| 14:09 | rhickey | Lau_of_DK: do you find it easy to find 2-4x speed gains? |
| 14:10 | rhickey | Chouser: scary |
| 14:10 | Chouser | I prefer (my-map my-key), personally. :-) |
| 14:10 | Chousuke | I like (key map) if key is a keyword. |
| 14:10 | rhickey | me too, and lots of those puns will still be in Clojure, (rest nil), nil/false, cond defaults etc |
| 14:11 | technomancy | Lau_of_DK: have you noticed imenu misses a lot of defns in clojure-mode? |
| 14:11 | Lau_of_DK | rhickey: No I certainly dont. I just wasnt sure if there was a 3.rd alternative |
| 14:11 | rhickey | so it won't be that bad |
| 14:11 | Chouser | ,(key map) |
| 14:11 | clojurebot | java.lang.ClassCastException: clojure.core$map__3546 cannot be cast to java.util.Map$Entry |
| 14:11 | Lau_of_DK | technomancy: no |
| 14:11 | duck1123 | cooldude127: That would probably be the best way. You might also put in common formats like :xsd:dateTime and :rfc822 |
| 14:12 | technomancy | Lau_of_DK: do you not use imenu, or has it just worked fine for you? |
| 14:12 | rhickey | Lau_of_DK: it ends up there are fundamental relationships between mutability, memory usage, and laziness |
| 14:12 | cooldude127 | duck1123: yeah that was the plan. it will be very easy to do that now |
| 14:12 | Chouser | rhickey: right, but I can see why you would want to keep the kind of progressive failure shown by that poem firmly in mind. |
| 14:12 | Lau_of_DK | technomancy: I just dont use it/know what it is |
| 14:12 | rhickey | Chouser: exactly |
| 14:12 | Lau_of_DK | rhickey: k |
| 14:12 | technomancy | Lau_of_DK: you should check it out some time; it's handy when it works. =) |
| 14:13 | technomancy | it gives you an index of all the defns in the current buffer so you can jump to them easily |
| 14:13 | Lau_of_DK | link? |
| 14:13 | rhickey | Chouser: because people have asked for each of those T 'features' individually before |
| 14:13 | technomancy | Lau_of_DK: do you ido? the ido version is much nicer if you use it |
| 14:14 | Lau_of_DK | ido, imenu..what are you talking about!? :) |
| 14:14 | cooldude127 | EMACS :) |
| 14:14 | duck1123 | cooldude127: It would also be cool if you could do things like (now ::Time) or (now ::Date) <-- replaces (today) |
| 14:15 | danlei | hm ... |
| 14:15 | durka42 | that sounds like a multimethod to me |
| 14:15 | danlei | if (if nil 1 2) is 2, and it will stay like that |
| 14:15 | cooldude127 | durka42: woohoo another case for multimethods! |
| 14:15 | cooldude127 | i'm addicted to them |
| 14:15 | danlei | but (if (rest [1]) 1 2) will be 1 |
| 14:16 | cooldude127 | shit that was for duck1123 |
| 14:16 | danlei | what exactly will (rest [1]) return? |
| 14:16 | technomancy | if so see the ido-imenu function here: http://github.com/technomancy/emacs-starter-kit/blob/29eb6f508dac5486f0790f4ecb8744bc5920f9df/starter-kit-defuns.el |
| 14:16 | technomancy | Lau_of_DK: otherwise just M-x imenu in a non-clojure buffer |
| 14:16 | danlei | i think i don't really get it :) |
| 14:16 | rhickey | danlei: something you could call seq or stream on |
| 14:17 | rhickey | (rest anything) would return something you could call seq or stream on |
| 14:17 | danlei | sag what will i have to use to test for emptyness? not nil? i guess ... |
| 14:17 | rhickey | danlei: seq |
| 14:17 | technomancy | Lau_of_DK: weren't you working with me on clojure-mode.el? was that someone else? |
| 14:17 | rhickey | just like now |
| 14:18 | Lau_of_DK | technomancy: I sure am :) |
| 14:18 | danlei | hm .. ok |
| 14:18 | Chousuke | danlei: (if (seq (rest [1])) 1 2) -> 2 |
| 14:18 | stuhood | 'scuse me... is it possible to get the Var that points to the current function, so that I could have the function print out its own docstring? |
| 14:18 | Chousuke | hmm |
| 14:18 | danlei | i see |
| 14:18 | danlei | thanks |
| 14:18 | rhickey | here's what changes - rest and the sequence fns return a logical-collection, on which you can call seq or stream |
| 14:19 | duck1123 | technomancy: is imenu working for you in clojure-mode? I've never been able to get it working right |
| 14:19 | rhickey | seq will still return a seq object with a valid first, or nil |
| 14:19 | danlei | ok |
| 14:19 | technomancy | duck1123: it doesn't work for me either; looking at clojure-mode.el makes me think it was never supported. |
| 14:20 | rhickey | I could make it so rest still returns nil, and a new fn (more aseq) returned a logical collection |
| 14:20 | duck1123 | I would love to have semantic support for clojure. I miss the function names along the side when using ecb |
| 14:20 | danlei | well, |
| 14:21 | danlei | if you ask me ... i'd like (rest [1]) to return nil, but that's just me |
| 14:21 | technomancy | duck1123: does ECB just rely on imenu? |
| 14:21 | technomancy | duck1123: I'm not likely to fix ECB support itself, but if it relies on imenu, I'm definitely going to try to fix that. |
| 14:21 | danlei | i'm not sure if i understand, why you will change it, in the first place |
| 14:22 | duck1123 | I think it uses whatever underlying support that imenu uses |
| 14:22 | technomancy | duck1123: cool |
| 14:23 | duck1123 | ecb is handy with clojure because you can set it so the slime repl is a compilation buffer. (and thus stays in a certain place) |
| 14:24 | cooldude127 | duck1123: WHAT? |
| 14:24 | cooldude127 | i didn't know you could do that |
| 14:24 | technomancy | seems like you could do that without ECB |
| 14:24 | technomancy | since ECB does a *lot* of stuff I don't care about. =) |
| 14:24 | duck1123 | I think I had to set a regex to match the buffer name, let me look it up |
| 14:25 | duck1123 | I keep it off 90% of the time, but every now and then it's handy |
| 14:25 | cooldude127 | right now 1/4 of my screen is this chat buffer, 1/8 is slime repl, 1/8 is a bitlbee aim chat, and the whole right half is my date library file |
| 14:26 | duck1123 | ecb-compilation-buffer-names |
| 14:31 | durka42 | does add-classpath work? |
| 14:31 | duck1123 | durka42: it'll always return nil, but it does work |
| 14:31 | durka42 | hmm |
| 14:32 | technomancy | duck1123: what kinds of defs should imenu index? def, defn, defn-... any others? |
| 14:32 | cooldude127 | technomancy: defmacro? |
| 14:32 | Chouser | defmulti |
| 14:32 | duck1123 | hell, def.* |
| 14:32 | cooldude127 | defmethod |
| 14:33 | technomancy | maybe def[-a-z]* |
| 14:33 | cooldude127 | that could work |
| 14:34 | duck1123 | Chance are, if you're working with a file with a lot of def* forms, you want easy access to those forms. |
| 14:35 | cooldude127 | technomancy: does what you're doing affect what shows up with ido-goto-symbol from your starter kit? cuz all i get are any defmethods and defmacros, prolly cuz they are standard CL names |
| 14:36 | technomancy | cooldude127: it should fix that, yeah |
| 14:36 | durka42 | -cp seems to work where add-classpath fails |
| 14:36 | cooldude127 | technomancy: awesome |
| 14:36 | durka42 | which seems strange because i thought they were equivalent |
| 14:36 | duck1123 | durka42: what are you trying to do? |
| 14:36 | technomancy | durka42: for clojure code or for java jars? |
| 14:37 | durka42 | clojure and java jars |
| 14:37 | durka42 | i'm trying to use compojure |
| 14:37 | technomancy | are you up to date? a bug in add-classpath was fixed a couple weeks ago |
| 14:37 | duck1123 | if you are adding a clojure source directory, make sure you end with a slash |
| 14:37 | durka42 | yeah, i'm up to date |
| 14:37 | durka42 | hmm |
| 14:38 | duck1123 | ie (add-classpath "file:///home/duck/compojure/src/clojure/") |
| 14:40 | durka42 | no, it still won't find the compojure jars |
| 14:40 | durka42 | even if i explicitly name them |
| 14:41 | duck1123 | durka42: Are you running this with jetty? If so, have you tried the old launcher script? (should still work) |
| 14:41 | durka42 | the one on wikibooks? |
| 14:42 | duck1123 | haven't seen the wiki in a while... |
| 14:43 | durka42 | are you referring to this script http://en.wikibooks.org/wiki/Compojure/Getting_Started |
| 14:43 | duck1123 | durka42: That looks pretty close to what I have, but mine had a whole lot more |
| 14:44 | AWizzArd | clojurebot: max people |
| 14:44 | clojurebot | max people is 128 |
| 14:45 | Chouser | Is this supposed to work? (definline add [x y] `(+ ~x ~y)) |
| 14:45 | duck1123 | http://gist.github.com/50145 is my old script/repl file. (I only launch as a servlet now) |
| 14:47 | karmazilla | newsflash: Users world-wide exclaim their excitement! New chunking undo and platform dependent control-key in textjure* is all the rage. |
| 14:48 | hiredman | ! |
| 14:49 | karmazilla | Yes. Both of them :) |
| 14:51 | durka42 | duck1123: yes, that script, with everything added explicitly to the classpath, works. so my problem is solved. it just irks me that (1) add-classpath doesn't work with the same paths as -cp, and (2) the directory above compojure/deps is on the classpath already and there isn't any recursive magic (but i suppose that isn't clojure's fault) |
| 14:53 | danlei | do i understand right, that the removal of nil-punning is due to performance issues? |
| 14:53 | danlei | and is there already something up to read about the stream stuff? |
| 14:54 | Chouser | the removal of nil-punning is not yet decided I think, and there are several options on the table that could yet save nil-punning. |
| 14:54 | Chousuke | danlei: as far as I understand it's to enable unification of stream and seq functions. |
| 14:54 | Chouser | danlei: http://clojure.org/streams |
| 14:54 | Chousuke | that LFE stuff went way over my head though :/ |
| 14:54 | danlei | oh, thats already updated to the changes? |
| 14:54 | danlei | i'll read it up then, thanks |
| 14:55 | danlei | but i understand right, that that will affect all the seq functions |
| 14:55 | danlei | sag so i'll have to stick a seq in front of ... for example (filter #(< 0 %) [1 2 3]) |
| 14:57 | Chousuke | only if you want a seq of it. |
| 14:57 | danlei | i mean |
| 14:57 | danlei | now it would return nil |
| 14:57 | danlei | but if i understand right |
| 14:58 | danlei | sag it will return a "logical stream"? |
| 14:58 | Chouser | danlei: what's "sag"? |
| 14:58 | danlei | sag and if i want to test it, i'll have to use seq, right? |
| 14:58 | danlei | sag oh |
| 14:58 | danlei | sag sorry |
| 14:58 | Chousuke | what. |
| 14:58 | danlei | just ignore it |
| 14:59 | durka42 | "a stream will ensure that it only has one iter" -- or else what? does the second thread requesting an iter get an exception? block? |
| 14:59 | danlei | so (if (filter ... will become (if (seq (filter ... |
| 14:59 | Chousuke | yeah |
| 14:59 | hiredman | karmazilla: most impressive |
| 14:59 | hiredman | how do I quit textjure? |
| 14:59 | technomancy | does this look like a reasonable way to match all def*s? "^\\s *\\((def[^ \t\n]*\\s *\\([-a-zA-Z]+\\)\\)" |
| 14:59 | karmazilla | control-Q |
| 14:59 | technomancy | (apart from the fact that Emacs regexs are insane) |
| 14:59 | karmazilla | or alt-F4, or whatever kills a window |
| 15:00 | technomancy | duck1123, Lau_of_DK: ^ |
| 15:00 | hiredman | I see |
| 15:00 | Chouser | danlei: if stream and seq functions are merged (not yet decided) and no other mitigation options are used (not yet decided) and you use a seq function like 'filter' and you want to know if it's returning an empty thing or not, you will then have to say (if (seq (filter... instead of (if (filter ... |
| 15:00 | durka42 | technomancy: on stupid platforms you might need to throw \r in there |
| 15:00 | technomancy | durka42: good catch; thanks |
| 15:00 | danlei | Chouser: ok, so i got it right |
| 15:00 | technomancy | [-a-zA-Z] is probably not permissive enough for symbols though |
| 15:00 | danlei | Chouser: then, |
| 15:00 | technomancy | maybe I should just use non-whitespace for that again |
| 15:01 | karmazilla | hiredman: you can close files and undo... now you want to quit it too?!? |
| 15:01 | durka42 | i think so, yes |
| 15:01 | danlei | Chouser: richs idea about rest still returning nil and introducing "more" or something |
| 15:01 | danlei | Chouser: wouldn't buy that much |
| 15:01 | durka42 | karmazilla: i want to recall previous expressions in the repl |
| 15:01 | karmazilla | me too :( |
| 15:02 | Chouser | danlei: that was my conclusion as well |
| 15:02 | Chouser | danlei: and the other option (of making boolean tests take end-ness as false) scares me |
| 15:02 | danlei | Chouser: yes, if thats the way it will be, rest should return that "logical stream" to |
| 15:02 | danlei | *too |
| 15:03 | Chouser | durka42: like *1 or arrow-up? |
| 15:03 | durka42 | i was talking about arrow-up, but both of those are nice |
| 15:04 | danlei | Chouser: why exactly does that scare you? |
| 15:04 | durka42 | or an ipython-like thing where there's an infinite history (a vector) instead of *1 *2 *3 |
| 15:04 | Chouser | durka42: the problem with that is it'll never let any of those values be gc'd |
| 15:05 | durka42 | hmm, true |
| 15:05 | Chouser | but yes, arrow-up history is definitely needed. but did you notice the automatic multi-line input support? |
| 15:06 | durka42 | i did |
| 15:06 | cooldude127 | anybody know why C-c C-k doesn't work in slime w/ clojure? or do i need to update my stuff? |
| 15:06 | durka42 | but i shall mercilessly compare it to gorilla, which has the same thing but the multiple lines are indented |
| 15:06 | Chouser | so I guess history recall should be triggered when you try to go above the top line or below the bottom line? |
| 15:07 | Chouser | durka42: ah, good. I haven't tried recent version of gorilla. |
| 15:07 | durka42 | or it could be something like M-up (i would suggest C-up but that doesn't work on OSX because Spaces grabs it) |
| 15:07 | durka42 | not above the top line -- you want to recall the history with the cursor on the last line |
| 15:08 | drewr | cooldude127: Never had a problem with it. What error do you get? |
| 15:08 | StartsWithK | rhickey: hi, in clojure api docs (add-watch a watcher callback) should be add-watcher. |
| 15:08 | drewr | StartsWithK: Probably should open a ticket. |
| 15:08 | drewr | (with patch :-)) |
| 15:08 | cooldude127 | drewr: java.lang.IllegalArgumentException: Wrong number of args passed to: basic$compile-file-for-emacs (NO_SOURCE_FILE:0) |
| 15:09 | Chouser | currntly the cursor can go up into the history -- would it be acceptible to provide simple hotkeys to go up an input-expression at a time, and then to re-send the block under the cursor to the repl again? |
| 15:09 | danlei | Chouser: wouldn't (if "", (if {}, (if [], (if ... returning true be the "right thing" in most use cases? |
| 15:09 | Chouser | StartsWithK: the web pages are meant to document the previous release, not svn head. |
| 15:09 | danlei | Chouser: oh ... returning false, sorry |
| 15:10 | te | Just bought the Clojure book from pragprog -- I'd like to get Gorilla working |
| 15:10 | te | Do you guys suggest emacs instead? |
| 15:10 | Lau_of_DK | YES |
| 15:10 | Chouser | danlei: I used to think so, and was pleased by Python's support for this. But a little programming in ruby convinced me the simplicity of its rules are better. |
| 15:10 | cooldude127 | what's gorilla? |
| 15:10 | Chouser | te: naw |
| 15:10 | durka42 | Chouser: oh, that could work. i was thinking press M-Up and the previous expression appears under the cursor, press M-Up again to back further, fix the error on the current line, and press enter to send it again |
| 15:10 | Lau_of_DK | te: Without the shadow of a doubt, do not get yourself into Vim :) |
| 15:10 | durka42 | cooldude127: kotarak's vim mode for clojure |
| 15:11 | danlei | Chouser: can you elaborate on why you think it's better? |
| 15:11 | cooldude127 | ok C-c C-k works again after updating all my clojure stuff |
| 15:11 | te | Ugh -- Tying a language to a specific editor is such a shit way of building a programming language |
| 15:11 | durka42 | Gorilla is pretty cool |
| 15:11 | te | I'm gonna try out Gorilla and if all else fails I guess I'll go with Emacs, but that's definitely my worst case scenario |
| 15:11 | danlei | Chouser: i mean: in 90% of the cases that would be exactly what you need |
| 15:11 | te | I'm not a fan |
| 15:12 | Lau_of_DK | durka42: Gorilla is very cool - But Vim is an artifact thats not really comparable to Emacs to be quite honest |
| 15:12 | Raynes | There is a netbeans plugin, in development, but it's there. |
| 15:12 | durka42 | yeah, about that... i installed it and now netbeans doesn't start :( |
| 15:12 | cooldude127 | enclojure? |
| 15:12 | Chouser | danlei: when each type of object can define it's own meaning for 'falseness', it makes it harder to read code. |
| 15:13 | cooldude127 | yeah that sounds insane |
| 15:13 | Raynes | It doesn't work on windows with the current binary release, it is fixed in the SVN and the newest binary release will be at the end of the month. |
| 15:13 | Chouser | danlei: when is a Date false? never? when it's midnight jan 1 1970? |
| 15:13 | cooldude127 | NEVER |
| 15:13 | danlei | Chouser: hm .. ok, maybe it's just a personal preference |
| 15:14 | danlei | Chouser: just if the structure holding the date is empty |
| 15:14 | cooldude127 | with my date library, that is never the case |
| 15:14 | cooldude127 | :) |
| 15:14 | Chouser | danlei: when is a socket false? when there's no more data, or only when the connection has been close, or only when it hasn't ever been opened? |
| 15:15 | danlei | Chouser: i'd say: the rule only holds for entitys for which "empty" is an attribute that makes sense |
| 15:15 | danlei | Chouser: but i do see your point |
| 15:15 | Chouser | each of these questions is addressed if you have a simple rule like only nil and false are false. Then code ends up like (if (empty? coll)... and (if (invalid? date)... and (if (closed? socket) ... |
| 15:16 | cooldude127 | which is much easier to read |
| 15:16 | karmazilla | durka42: I was thinking about making meta-up for going back in repl history. I find it annoying that this might not work on leopard :( |
| 15:17 | Chouser | danlei: The problem is once the meaning of falseness is dependent on the type of object, people will want their own new types to define their own new meanings |
| 15:17 | durka42 | meta is fine, assuming meta is option or the apple key |
| 15:17 | danlei | Chouser: that sounds reasonable ... but i must say, i doubt that it would be a problem for me, if things for which "empty" is clearly defined would be false, if they contain nothing |
| 15:17 | durka42 | control-arrow keys are taken |
| 15:17 | durka42 | unless spaces is configurable |
| 15:17 | karmazilla | durka42: it's the Command (apple) key |
| 15:17 | danlei | Chouser: i see, you have some strong points |
| 15:18 | te | I don't have clojure-contrib.jar with my macports install of clojure |
| 15:18 | cooldude127 | durka42: spaces is configurable, but i think most would rather leave spaces alone |
| 15:18 | durka42 | karmazilla: oh, you can change the modifier for spaces, too |
| 15:18 | te | it seems necessary to use gorilla.jar |
| 15:18 | danlei | Chouser: but, from a pragmatic point of view, i don't think i'm convinced |
| 15:18 | durka42 | i think the default is control, because i don't remember changing it |
| 15:18 | danlei | Chouser: it sure wold be "cleaner" |
| 15:18 | cooldude127 | clojure is in macports? |
| 15:18 | cooldude127 | wow it is :) |
| 15:18 | durka42 | te: i don't know about macports, but contrib is a separate svn repo from clojure core |
| 15:18 | cooldude127 | te: you need to check that out separately |
| 15:19 | te | cooldude127: durka42 thanks |
| 15:19 | durka42 | 20080916 sounds rather old |
| 15:19 | durka42 | is that before the google code migration? |
| 15:19 | cooldude127 | 20081217 is what my macports shows |
| 15:19 | te | i have 80916 i believe |
| 15:19 | cooldude127 | i use an svn checkout, but i did port search |
| 15:19 | te | i just pulled clojure down |
| 15:19 | danlei | Chouser: thank you for the explanation of your pov |
| 15:20 | cooldude127 | te: might want to do a port selfupdate |
| 15:20 | Chouser | danlei: I think that's my best argument, and if you're not convinced, that's fine. Like I said, I thought it was a feature of Python for quite a while, and later decided it was a mis-feature. |
| 15:20 | hiredman | clojurebot: latest? |
| 15:20 | clojurebot | latest is 1221 |
| 15:20 | Chouser | But it's certainly a trade-off, one way or the other. |
| 15:20 | cooldude127 | well wtf does that mean |
| 15:20 | te | cooldude127: good idea, doing it right now |
| 15:20 | durka42 | well, (date (clojurebot latest)) is 20090121, isn't it |
| 15:20 | hiredman | the latest svn rev is 1221 |
| 15:20 | te | there it goes -- 1217 |
| 15:21 | danlei | Chouser: i understand. i think it really boils down to personal preferences, or "taste", if you will |
| 15:21 | durka42 | 20081217 refers to a date, and is not related to rev #1221... |
| 15:21 | cooldude127 | yes |
| 15:21 | cooldude127 | who knows what svn rev that is |
| 15:22 | durka42 | 1173 or thereabouts |
| 15:22 | hiredman | most likely 1173 |
| 15:22 | cooldude127 | oh |
| 15:22 | hiredman | svn rev 1173 |
| 15:22 | clojurebot | svn rev 1173; updated readme with run and build lines |
| 15:22 | cooldude127 | that's not terrible |
| 15:23 | Chouser | danlei: either that or one of us is wrong but doesn't know it yet. ;-) |
| 15:23 | cooldude127 | lol |
| 15:25 | te | how do I install clojure-contrib on top of clojure.jar |
| 15:25 | te | from macports, that is |
| 15:25 | cooldude127 | te: checkout clojure-contrib from svn, run ant, and then add clojure-contrib.jar to your classpath |
| 15:26 | durka42 | i wonder if latest contrib will play nice with non-latest core |
| 15:26 | te | ^^was wondering that myself |
| 15:26 | cooldude127 | te is gonna find out :) |
| 15:26 | te | :) |
| 15:26 | te | cooldude127: sorry again, total noob here, how do i modify my classpath |
| 15:26 | te | is there a file or something? |
| 15:27 | durka42 | there is an environment variable, $CLASSPATH |
| 15:27 | cooldude127 | te: depends on how you're using clojure |
| 15:27 | durka42 | also you can path arguments to java |
| 15:27 | durka42 | namely -cp |
| 15:27 | cooldude127 | te: by your noobness, i assume you're not using emacs |
| 15:27 | te | correct sir, in fact, the whole reason im doing this is because id like to start playing with gorilla |
| 15:27 | te | to find out if emacs == necessity |
| 15:28 | durka42 | contrib comes with a launch script for bash |
| 15:28 | cooldude127 | oh. well idk how gorilla runs clojure or if it just connects to it |
| 15:28 | durka42 | gorilla relies on contrib/stream-repl |
| 15:28 | cooldude127 | oh |
| 15:28 | cooldude127 | this may be outside my expertise |
| 15:29 | durka42 | te: are you on linux? |
| 15:29 | cooldude127 | he's on os x |
| 15:29 | cooldude127 | macports |
| 15:29 | te | ^^ |
| 15:29 | durka42 | oh, right |
| 15:29 | durka42 | that |
| 15:29 | te | my clojure.jar is in /opt/local/share/java/clojure/lib/ |
| 15:30 | te | can i just go ahead and move clojure-contrib.jar to that location |
| 15:30 | te | along with the classes directory? |
| 15:30 | durka42 | don't need the classes directory, it's packed into the jar |
| 15:30 | cooldude127 | te: the jar should be all that is necessary |
| 15:30 | durka42 | but can you launch clojure currently? |
| 15:30 | te | okay cool -- so i can just move her in? |
| 15:30 | durka42 | without modifying the classpath |
| 15:30 | te | durka42: yeah macports makes a little clj.sh script |
| 15:30 | te | clj from the command like runs the REPL |
| 15:30 | te | line* |
| 15:31 | cooldude127 | huh, maybe you could paste that script? |
| 15:31 | durka42 | lisppaste8: url? |
| 15:31 | te | sure, let me look |
| 15:31 | lisppaste8 | To use the lisppaste bot, visit http://paste.lisp.org/new/clojure and enter your paste. |
| 15:31 | te | thanks |
| 15:32 | lisppaste8 | te pasted "clj macports" at http://paste.lisp.org/display/73989 |
| 15:33 | cooldude127 | te: this file on its own won't do it |
| 15:33 | te | so maybe i need to add a couple lines to exec java -classpath $cljcontrib |
| 15:33 | te | ? |
| 15:33 | cooldude127 | te: need to do -classpath $cljjar:/path/to/clojure-contrib.jar ... |
| 15:33 | durka42 | what he said |
| 15:35 | te | cooldude127: ah-ha okay |
| 15:35 | te | running clj... |
| 15:35 | cooldude127 | duck1123: how would you think date parsing should work? i realized that java's stuff parses differently for dates, datetimes, and times, so should i do something like (parse-date "2/4/2009" ::Date :short) ? or is that too complex? |
| 15:36 | cooldude127 | duck1123: or maybe (parse-dat "2/4/2009" :short-date) |
| 15:37 | karmazilla | how about something like datejs? |
| 15:37 | cooldude127 | karmazilla: huh? |
| 15:37 | karmazilla | cooldude127: http://www.datejs.com/ |
| 15:37 | duck1123 | cooldude127: That looks reasonable, I prefer the first one. |
| 15:37 | te | cooldude127: like this? exec java -classpath $cljjar $cljclass $cljjar:/opt/local/share/java/clojure/lib/clojure-contrib.jar |
| 15:38 | cooldude127 | te: colon-separated for the classpath |
| 15:38 | te | it is colon separated? no? |
| 15:39 | cooldude127 | te: exec java -classpath $cljjar:/opt/local/share/java/clojure/lib/clojure-contrib.jar $cljclass |
| 15:39 | te | ah, okay, that's what you mean |
| 15:40 | cooldude127 | sorry i didn't see the part that was before |
| 15:40 | te | no problem |
| 15:40 | cooldude127 | karmazilla: that's a little over my head |
| 15:40 | te | okay it runs, now to check if it worked... |
| 15:40 | te | cooldude127: how can i make sure i loaded contrib? |
| 15:40 | cooldude127 | duck1123: the reason for the second one is that otherwise there is a different arglist for string formats and built-in ones |
| 15:41 | cooldude127 | te: (use 'clojure.contrib.def) |
| 15:41 | karmazilla | cooldude127: and I imagine that i18n won't make it easier. Yet, it would be pretty cool, methinks :) |
| 15:41 | duck1123 | what would a built in one look like? |
| 15:42 | cooldude127 | duck1123: the short, medium, long ones |
| 15:42 | cooldude127 | (parse-date "2/4/2009" :short-date) |
| 15:42 | cooldude127 | vs. |
| 15:42 | durka42 | sorry about that |
| 15:42 | durka42 | ran out of battery life |
| 15:42 | cooldude127 | (parse-date "2/4/2009" "m/d/yyyy") |
| 15:42 | cooldude127 | i don't know if either of those are right formats but you get what i mean |
| 15:43 | durka42 | te: what did i miss? |
| 15:43 | hiredman | cooldude127: where is this date gist? |
| 15:43 | duck1123 | how about (parse-date "2/4/2009" [::Date :short]) |
| 15:44 | cooldude127 | duck1123: i thought about that |
| 15:44 | cooldude127 | hiredman: http://gist.github.com/49656 |
| 15:45 | duck1123 | or reverse the order, make the default for the last param be DateTime |
| 15:45 | cooldude127 | duck1123: what happens to ::Date tho once we are outside the clojure.contrib.date namespace |
| 15:46 | te | bleh lots of errors |
| 15:46 | cooldude127 | te: it didn't work then |
| 15:46 | te | it ran with clojure-contrib alright |
| 15:46 | te | but gorilla.jar not so much |
| 15:46 | cooldude127 | oh |
| 15:46 | duck1123 | would it matter? I thought that was a difference between symbols and keywords |
| 15:46 | te | i added to that cljjar line like this: |
| 15:47 | te | exec java -classpath $cljjar:/path/to/clj-contrib.jar:gorilla.jar de.kotka.gorilla $cljclass |
| 15:47 | cooldude127 | duck1123: ::Date makes it resolve to :clojure.contrib.date/Date |
| 15:47 | te | i put gorilla.jar into my lib folder |
| 15:47 | te | perhaps i need to specify the full path |
| 15:47 | durka42 | need the full/path/to/gorilla.jar again |
| 15:47 | cooldude127 | te: i would do that |
| 15:47 | cooldude127 | te: in the user package, ::Date becomes :user/Date |
| 15:48 | cooldude127 | no not te |
| 15:48 | cooldude127 | duck1123: last message i sent to te |
| 15:48 | te | Caused by: java.lang.IllegalArgumentException: Don't know how to create ISeq from: Symbol (repl_ln.clj:0) |
| 15:48 | te | yucky |
| 15:48 | cooldude127 | te: might want to try an up-to-date clojure |
| 15:48 | te | yeah im going to do that right now |
| 15:49 | durka42 | repl_ln.clj:0 is most likely an ns line... did that change recently? |
| 15:49 | te | sorry for all the issues, i appreciate the hell |
| 15:49 | durka42 | i get te's error when i do (ns 'stuff) instead of (ns stuff) |
| 15:49 | te | help* |
| 15:49 | te | hell, too :) |
| 15:49 | cooldude127 | lol |
| 15:49 | karmazilla | te: if you plan on trying Emacs after gorilla, then textjure might have grown into a fully featured editor by the time you're done :P |
| 15:49 | te | HAHAHA |
| 15:49 | te | oh wait, not laughing at texture |
| 15:50 | cooldude127 | lol |
| 15:50 | te | i read that as, "if you have enough problems, maybe you'll start using emacs" |
| 15:50 | te | :) |
| 15:50 | cooldude127 | emacs is good :) |
| 15:50 | cooldude127 | slime is good |
| 15:50 | te | i just suck at Emacs and don't want to learn it if i can avoid it :) |
| 15:51 | cooldude127 | te: which one of us has a working clojure repl ? ;) |
| 15:51 | Chouser | I usually use neither emacs nor gorilla. |
| 15:51 | Chouser | I should do a little screencast or something. |
| 15:51 | cooldude127 | Chouser: screencasts are always good |
| 15:52 | Chouser | Though nobody wants to do it my way either, it would just be to prove it's possible. ;-) |
| 15:52 | gnuvince | Chouser: and then you should install Emacs and Slime ;) |
| 15:52 | karmazilla | Chouser: what editor do you use? (don't tell me it's pico) |
| 15:52 | hiredman | there is a slime.vim that uses screen to send code to a repl |
| 15:52 | Chouser | I use vim |
| 15:52 | hiredman | it works ok, it is what I use |
| 15:52 | Chouser | hiredman: really? I was sure you used emacs. |
| 15:53 | cooldude127 | is there a short way to get to symbols like ::Date from an outside package? |
| 15:53 | hiredman | hell no |
| 15:53 | cooldude127 | ok i'll bbiab, have to leave class :) |
| 15:53 | mattrepl | does vim have anything like paredit for basic structural editing? |
| 15:53 | duck1123 | cooldude127: it looks like aliases work (ie. ::date/Date |
| 15:53 | hiredman | cooldude127: keyword |
| 15:53 | durka42 | mattrepl: yes and no, there is surround.vim |
| 15:53 | Chouser | cooldude127: not right now. If you look way back to when you started with 'derive' today, you'll see Rich metioned using `Date |
| 15:54 | durka42 | mattrepl: in paredit option-shift-(, in vim (in command mode) ys%) |
| 15:54 | Chousuke | ::date/Date? :/ |
| 15:54 | Chousuke | that looks wrong; should be :date/Date |
| 15:55 | durka42 | mattrepl: but it doesn't have ( bound to make () |
| 15:55 | duck1123 | if you alias clojure.contrib.date to date, then ::date/Date will return ::clojure.contrib.date/Date |
| 15:55 | Chousuke | ah, it's smart? |
| 15:56 | duck1123 | correction :clojure.contrib.date/Date |
| 15:56 | mattrepl | does it have the ability to yank a sexp? or move the level of a pair? |
| 15:56 | hiredman | duck1123: with surround.vim "(" makes "()" and other brackets are pound similarly |
| 15:57 | hiredman | http://groups.google.com/group/comp.lang.lisp/msg/81a24e488491e8ff <-- c.l.l posting on lisp+vim tips |
| 15:57 | durka42 | hiredman: it does? mine doesn't :\ |
| 15:57 | mattrepl | hiredman: thanks |
| 15:58 | hiredman | durka42: huh, maybe that is not surround.vim then |
| 15:58 | hiredman | mine does that |
| 15:58 | hiredman | maybe autoclose.vim? |
| 15:59 | hiredman | ah |
| 15:59 | hiredman | yes, autoclose.vim http://www.vim.org/scripts/script.php?script_id=1849 |
| 15:59 | durka42 | yanking an s-exp would just be y% with the cursor on one of the parens |
| 16:01 | te | Something is screwy with gorilla :\ |
| 16:01 | te | I have the current clojure.jar and clojure-contrib.jar, setup the local.properties file in gorilla's dir, run ant, tons of errors |
| 16:02 | durka42 | does the local.properties file have the correct paths? :) |
| 16:02 | duck1123 | has anyone tried to build clj-doc recently? |
| 16:02 | durka42 | what kinds of errors |
| 16:03 | te | durka42: yeah paths are correct |
| 16:03 | erohtar | hi - i was wondering if there is any way to 'undef' something |
| 16:03 | durka42 | (doc ns-unmap) |
| 16:03 | clojurebot | Removes the mappings for the symbol from the namespace.; arglists ([ns sym]) |
| 16:04 | erohtar | durka42: thanks |
| 16:04 | durka42 | te: hmm, do you want to pastebin some of the errors |
| 16:04 | te | durka42: [java] java.lang.IllegalArgumentException: Don't know how to create ISeq from: Symbol (repl_ln.clj:15) |
| 16:04 | te | thats #1 |
| 16:05 | te | could it be my java setup at this point? |
| 16:05 | durka42 | it could be the fact that you don't have the latest clojure.core |
| 16:05 | durka42 | let me port install and see |
| 16:06 | te | durka42: i updated to latest |
| 16:06 | durka42 | oh |
| 16:06 | te | i have the latest clojure and clojure-contrib, trying toget gorilla working, triedf the stable gorilla, and now the development versions |
| 16:06 | te | both spit out errors |
| 16:07 | te | maybe i need the new ant? |
| 16:07 | durka42 | no, that's a clojure error i think |
| 16:08 | durka42 | i am thinking the old clojure is still getting used somehow |
| 16:09 | durka42 | i get that error using the macports one but not using the latest one |
| 16:09 | te | i blew away the old clojure |
| 16:09 | durka42 | and you have the latest from google code |
| 16:09 | te | nod |
| 16:11 | durka42 | so you run ant in the contrib directory and it spits out that error |
| 16:11 | LordOfTheNoobs | <tech-support-voice> did you leave the old clojure running? </> |
| 16:11 | te | durka42: no my contrib is compiled |
| 16:11 | te | i then moved it to my ~/clojure directory |
| 16:11 | te | to be with clojure.jar |
| 16:11 | te | im talking about building the gorilla.jar |
| 16:12 | te | it tells me build successful, but i get a mess of errors |
| 16:12 | karmazilla | shame you aren't on Windows. It's amazing the kind of issues a reboot can fix on that platform |
| 16:13 | durka42 | hmm, try running a repl and use repl-ln |
| 16:13 | durka42 | in the directory with clojure.jar, java -cp clojure.jar clojure.main |
| 16:13 | durka42 | actually do java -cp clojure.jar:clojure-contrib.jar clojure.main |
| 16:13 | durka42 | then type (use 'clojure.contrib.repl-ln) |
| 16:14 | te | java.lang.IllegalArgumentException: Don't know how to create ISeq from: Symbol (repl_ln.clj:0) |
| 16:15 | durka42 | then i must insist that your clojure.jar is old |
| 16:15 | kotarak | te: which versions of clojure and contrib are you using? |
| 16:15 | te | let's see, how do i check |
| 16:15 | kotarak | te: where did you get it from? |
| 16:15 | te | googlecode on both counts |
| 16:16 | hiredman | ,(doto "foo" .toUpperCase) |
| 16:16 | clojurebot | "foo" |
| 16:16 | kotarak | The "december" release? |
| 16:16 | te | clojure_20081217.zip |
| 16:16 | kotarak | ok. |
| 16:16 | kotarak | just a sec |
| 16:16 | te | want me to try to do this again with contrib? |
| 16:17 | te | err recompile with contrib, to be sure |
| 16:17 | te | i cant seem to find the original zip i got with contrib in it |
| 16:17 | durka42 | i would use the latest clojure svn if that doesn't work |
| 16:17 | te | oh wait, i pulled it from svn |
| 16:17 | te | yeah ill pull the clojure svn and use that with the contrib svn |
| 16:18 | cooldude` | te: that should work, they are happy together |
| 16:18 | duck1123 | or http://github.com/kevinoneill/clojure-contrib/zipball/master |
| 16:18 | kotarak | te: you may use Clojure < rev 1192 and contrib < rev 331 and Gorill 1.1.0 |
| 16:18 | kotarak | te: later SVN revs with Gorilla 1.1.1 |
| 16:19 | te | kotarak: let me try again with the latest contrib/clojure |
| 16:19 | te | should i try 1.1.1 with those, or the development version? |
| 16:20 | kotarak | 1.1.1 is basically identical to dev at the moment. |
| 16:20 | te | okay, ill retry this once i rebuild clojre from svn |
| 16:20 | kotarak | dev is not guaranteed to work at all. |
| 16:21 | te | a simple `ant clean jar`is all i need on the clojure svn repo right? |
| 16:21 | te | no special stuff? |
| 16:22 | cooldude` | te: i think so |
| 16:22 | kotarak | That should be fine. |
| 16:22 | Fib | Hm, is there a reason there are fns (not-any?) and (every?) and (not-every?), but no (any?) |
| 16:22 | Chousuke | I think jar depends on clean so "ant jar" should do. maybe even just "ant" :p |
| 16:22 | te | yeah i just ran ant, just wanted to bmake sure there isnt a devil in the details |
| 16:23 | Chousuke | (doc some?) |
| 16:23 | clojurebot | It's greek to me. |
| 16:23 | Chousuke | hmm |
| 16:23 | Chousuke | was it some then :/ |
| 16:23 | Chousuke | (doc some) |
| 16:23 | clojurebot | Returns the first logical true value of (pred x) for any x in coll, else nil. One common idiom is to use a set as pred, for example this will return true if :fred is in the sequence, otherwise nil: (some #{:fred} coll); arglists ([pred coll]) |
| 16:23 | Fib | Ah, thanks |
| 16:24 | te | Eureka! it compiled kotarak |
| 16:24 | kotarak | te: btw: be warned! Gorilla is... well... not very stable at the moment. I'm working on getting rid of Ruby, though. That should improve the situation. |
| 16:24 | kotarak | te: congrats |
| 16:24 | cooldude` | kotarak: what are you gonna do instead? |
| 16:25 | te | kotarak: is this your project? |
| 16:25 | te | thanks for all your hard work! |
| 16:25 | kotarak | cooldude`: nailgun seems to do the trick. |
| 16:25 | kotarak | te: yep. I'm the author of Gorilla. |
| 16:25 | te | kotarak: what are you going to use instead of ruby |
| 16:25 | cooldude` | kotarak: what's that? |
| 16:26 | kotarak | te, cooldude`: http://www.martiansoftware.com/nailgun/ |
| 16:26 | kotarak | Basically command-line interface to a Java server. |
| 16:26 | te | ah-ha |
| 16:26 | te | better for debugging maybe? |
| 16:26 | kotarak | Let's you build fast unix "commands". |
| 16:26 | te | kotarak: what about Jruby? |
| 16:26 | cooldude` | nifty |
| 16:26 | te | have you looked at that at all? |
| 16:27 | kotarak | te: no. The Ruby part runs inside Vim. JRuby won't help. |
| 16:27 | te | ah |
| 16:27 | te | I played with Jruby a little bit, it's at least a lot faster |
| 16:27 | Chouser | kotarak: ooh, I've been looking for something like nailgun. |
| 16:28 | kotarak | Chouser: eclim uses it to make Vim work with Eclipse. :) |
| 16:30 | Chouser | kotarak: does vim have nailgun client built in or something? |
| 16:30 | durka42 | (alter-meta! durka assoc :away true) |
| 16:30 | kotarak | Chouser: no. You simply call it like a usual unix command. |
| 16:31 | kotarak | stdin, stdout and stderr are forwarded. |
| 16:31 | kotarak | as are command line args. |
| 16:31 | Chouser | so from vim you're "shelling out" |
| 16:31 | cooldude` | i must say, clojure's syntax quote is quite possibly the best thing ever |
| 16:32 | kotarak | Chouser: yes. At least more stable (and Vim like) than the Ruby stuff.... |
| 16:32 | Chousuke | the biggest complaint about ` I have is that it's a backtick :P |
| 16:32 | cooldude` | lol |
| 16:32 | cooldude` | that's a small complaint |
| 16:32 | Chousuke | but I should be coding with a US layout anyway |
| 16:33 | te | kotarak: how do i connect to the instance of gorilla with vim now? |
| 16:34 | durka42 | if you have the plugin loaded, \sr to start a repl |
| 16:34 | kotarak | te: \et to send toplevel expressions, \lw to lookup the docstring of word under the cursor, \sr for starting a repl |
| 16:34 | kotarak | te: There is a help file with all the commands in the doc directory. |
| 16:35 | te | kotarak: yeah, \sr didn't work for me --> ':\sr', right? |
| 16:35 | durka42 | no \ is the local leader |
| 16:35 | durka42 | if the s just puts you in insert mode, the plugin might not be loaded |
| 16:35 | Lau_of_DK | How much energy do you guys spend daily, trying to make Vim mimic the awesome power of Emacs just a little bit? |
| 16:35 | durka42 | took me a while to get it to load |
| 16:35 | te | durka42: yeah that's probably it |
| 16:36 | te | i dropped gorilla.vim into ftplugin |
| 16:36 | te | in my ~/vim |
| 16:36 | Chousuke | \ is another character that needs a US layout :/ |
| 16:36 | Chouser | Lau_of_DK: how many hours have I wasted paging through "I can't get slime working" message on the google group? |
| 16:36 | durka42 | Lau_of_DK: and there isn't endless .emacs munging? |
| 16:36 | Chousuke | it's even more painful to type on a finnish layout than ` |
| 16:36 | Lau_of_DK | durka42: No not that Im aware of |
| 16:37 | Lau_of_DK | Chouser: I cant say, but I got it working pretty fast |
| 16:37 | te | fuck my vim doesn't have ruby |
| 16:37 | Lau_of_DK | Anyway, SLIME itself shows the superiority of Emacs, that kind of integration of external apps is impossible in Vim, it always ends up being hacks |
| 16:38 | technomancy | Lau_of_DK: what are you talking about man vimscript rules |
| 16:38 | durka42 | te: oh, also! you have to have .clj file open or the \sr et al mappings aren't loaded |
| 16:38 | durka42 | now i really have to go |
| 16:38 | Chousuke | I wish viper.el weren't so buggy though :( |
| 16:38 | Chousuke | it refused to play nice with egg |
| 16:38 | Lau_of_DK | Chouser: Is that the sigh of man who knows he's fighting a lost cause? |
| 16:38 | te | durka42: thanks for all the help |
| 16:38 | te | cheers |
| 16:39 | danlei | there is only one problem about emacs: if you manage to lose youre .emacs (which happened to me once), you'll get suicidal :) |
| 16:39 | cooldude` | danlei: github ftw |
| 16:40 | technomancy | indeed; if you're not storing important code in version control, you may very well deserve what you get. |
| 16:41 | Chouser | the cause of avoiding unhelpful name-calling is indeed almost certainly lost |
| 16:41 | Chousuke | I learned that after I made the mistake of thinking that a one-file project needs no version control |
| 16:41 | danlei | i don't have it under version control, and i don't miss it, but i have several backups now (synced often). that won't happen again :) |
| 16:41 | Chouser | but I will fight on, if through no other means than the occasional emoted sigh |
| 16:41 | Chousuke | though at the time I didn't know of git so setting up a repo would've been painful :/ |
| 16:41 | Lau_of_DK | Chouser: No body's calling names |
| 16:41 | rhickey | Chouser: lost when? |
| 16:42 | Chouser | rhickey: at the fall of Man, most likely. |
| 16:42 | Lau_of_DK | I just think its an interesting discussion - If you compare writing a book in Notepad vs Word, you have a somewhat accurate description of trying to use Vim for coding compared to Emacs, so its fascinating that some people still linger |
| 16:42 | te | oh god im going to end up learning emacs |
| 16:42 | te | and its going to suck |
| 16:42 | ecret | is it possible to see the jars loaded in the vm when clojure is running? |
| 16:42 | rhickey | I just hopped on, but am firmly in the no-name-calling camp |
| 16:43 | Chousuke | te: viper.el might help you |
| 16:43 | rhickey | here and on the group |
| 16:43 | technomancy | te: it's that or learning vimscript |
| 16:43 | cooldude` | is def-java-date-formatter too long a macro name? |
| 16:43 | Chouser | te: you really don't need to. I don't know how much I can help you on the Mac, but I get along just fine using vim with no fancy integrated repl. |
| 16:43 | Lau_of_DK | rhickey: No body is calling anybody anything, Chousers just sad that he's finally realized Vim is inferior to Emacs |
| 16:43 | Chousuke | Lau_of_DK: maybe you should stop being so assertive about it :) |
| 16:44 | Chousuke | from a structural standpoint, emacs is indeed superior, but that doesn't make it any nicer to use ;( |
| 16:45 | te | i dont mean to hate on emacs -- ive tried learning it, but its such an up front cost to learning a language |
| 16:45 | te | i get all excited to learn lisp and its like "oh yeah, dont touch lisp without knowing emacs" |
| 16:45 | danlei | rhickey: i've read up on streams and now understand the issue, and its consequences, as far as nil-punning is concerned. sorry for commenting, while being that uninformed. (having thought about it, i, personally, am in favor of the emptyness will act like false in tests proposal) |
| 16:45 | cooldude` | te: i learned it for common lisp. so glad i did :) |
| 16:45 | te | it just kills a lot of the passion of the moment, like "today im going to learn lisp! yay!" |
| 16:45 | Lau_of_DK | I wasnt trying to strike up a flamewar, but in a channel where there are frequently newcomers, there's no sense in "helping" them waste precious time and years in Vim when they can get going in a real IDE from the beginning, I think its quite wrong to give such bad advice |
| 16:45 | te | and then you realize you ahve to learn an editor instead |
| 16:46 | rhickey | danlei: unfortunately that option is least likely, for performance reasons alone |
| 16:46 | te | it just takes a lot of the fun out of it |
| 16:46 | icey | now that Clojure is gaining popularity so quickly, has there been any discussion about the creation of a planet.clojure.org? |
| 16:46 | Chousuke | Lau_of_DK: see now, that's exactly the wrong way to put it. |
| 16:46 | hiredman | there is a yahoo pipe thing that agregates some clojure related feeds |
| 16:46 | icey | yeah, Bill Clementson's pipe, right? |
| 16:47 | technomancy | te: you could start with elisp. =) |
| 16:47 | Lau_of_DK | te: Dont get all down about it, Emacs is great, when you master it, it'll support you and speed you up like nothing else |
| 16:47 | hiredman | dunno whose it is |
| 16:47 | Lau_of_DK | Chousuke: Why do you think so ? |
| 16:47 | technomancy | icey: I was playing around with something actually written in clojure that uses the rome parsing lib |
| 16:47 | te | Lau_of_DK: yeah I'm going to learn it I guess, i just think it's kind of a sad state of affairs when langs rely so heavily on editors |
| 16:47 | te | thats my jaded opinion, i suppose |
| 16:47 | technomancy | icey: it worked great, but I haven't gotten around to HTML templating yet. |
| 16:47 | Chousuke | Lau_of_DK: you fail to admit that vim has any good qualities. |
| 16:47 | technomancy | can make it public if you want to help |
| 16:48 | icey | technomancy: very cool. it'd just be nice to be able to stop in on a planet when making my rounds :D |
| 16:48 | Lau_of_DK | te: Do yourself a big favor and checkout Bill Clements blogposts regarding Emacs + Slime, theyre very good |
| 16:48 | icey | regarding emacs, the peepcode screncast is pretty decent as well |
| 16:48 | Chouser | te: don't let emacs get in the way of clojure. You don't need it. |
| 16:48 | technomancy | icey: thanks! |
| 16:48 | Lau_of_DK | Chousuke: I dont deny it, I just havent come across any of them yet |
| 16:48 | te | Chouser: noted |
| 16:48 | Chousuke | Lau_of_DK: the modal interface. |
| 16:48 | cooldude` | Chousuke: i'll admit that vim is efficient |
| 16:48 | icey | that being said, i'm an emacs neophyte; so if there are technical problems with it, I don't know about it. |
| 16:48 | Chousuke | Lau_of_DK: it just makes sense. |
| 16:49 | te | ill probably end up using the REPL to write code, and then write it down in a separate editor |
| 16:49 | technomancy | icey: lack of concurrency and dynamic binding by default, but they're going to be addressed in the next version |
| 16:49 | te | thats how ive done it with ruby historically |
| 16:49 | Lau_of_DK | te: Go ahead and waste your time if you want |
| 16:49 | Chouser | Lau_of_DK: please stop |
| 16:49 | danlei | rhickey: well, it's just, what i'd prefer. it surely won't kill me, if i had to use an explicit test. (and chouser had some firm arguments for that) but, btw. if that's the way it will be, i think it would be ok to have rest return a "logical stream". having both, rest and more, wouldn't buy that much. |
| 16:49 | te | Lau_of_DK: im an expert on time wasting |
| 16:49 | Fib | clojurebot: paste |
| 16:49 | clojurebot | paste is http://paste.lisp.org/new/clojure |
| 16:49 | technomancy | Lau_of_DK: sheesh; you're not exactly helping |
| 16:49 | Lau_of_DK | :) |
| 16:49 | Chouser | Lau_of_DK: learning emacs is a waste of time if your goal is to learn clojure |
| 16:49 | Lau_of_DK | Chouser: Dead wrong |
| 16:50 | te | dont worry about him, ive met far more irc'ers with hardcore nerd rage than Lau_of_DK |
| 16:50 | Lau_of_DK | Im not angry, Im just telling you the truth |
| 16:50 | Lau_of_DK | If you dont want it, thats fine with me :) |
| 16:50 | te | haha, tbh i just wanted to use the term 'nerd rage' |
| 16:50 | technomancy | it's a good term |
| 16:51 | Chousuke | Lau_of_DK: Only Niilo Paasivirta has True Opinions(TM). You are limited to your own opinions |
| 16:51 | te | lispers qualify 9/10 for nerg rage |
| 16:51 | te | in my experience |
| 16:51 | te | nerd* |
| 16:51 | te | zerg rage, too |
| 16:51 | technomancy | Lau_of_DK: on a more constructive note, I've got imenu support working in clojure-mode, so give it a look. |
| 16:51 | Chouser | but this isn't just IRC, it's #clojure. We aspire to better than that. |
| 16:51 | technomancy | lemme know if it works for you |
| 16:52 | hiredman | clojurebot: #clojure? |
| 16:52 | clojurebot | clojure is a very attractive hammer with a nice heft to it |
| 16:52 | technomancy | cooldude`: were you wanting that too? |
| 16:52 | cooldude` | yes |
| 16:52 | hiredman | clojurebot: #clojure is <reply>this is not IRC, this is #clojure. We aspire to better than that. |
| 16:52 | clojurebot | c'est bon! |
| 16:52 | hiredman | clojurebot: #clojure? |
| 16:52 | rhickey | Interesting JVM/TCO news: http://mail.openjdk.java.net/pipermail/mlvm-dev/2009-January/000331.html |
| 16:52 | clojurebot | this is not IRC, this is #clojure. We aspire to better than that. |
| 16:52 | technomancy | cooldude`: http://github.com/technomancy/clojure-mode/tree/master |
| 16:53 | technomancy | rhickey: wow; that's great. how does stuff percolate up from "prototype" to "openjdk" to "official jdk"? |
| 16:53 | lisppaste8 | Fib pasted "zipWith" at http://paste.lisp.org/display/73991 |
| 16:54 | cooldude` | technomancy: is there a reason your repo is missing the clojure-paredit and clojure-auto files? |
| 16:54 | rhickey | technomancy: still to be seen, but those interested can play with MLVM in progress |
| 16:54 | Fib | Does this look like reasonable clojure style? |
| 16:54 | technomancy | cooldude`: it's all inlined now; if you want to enable paredit, you just set a var |
| 16:54 | cooldude` | technomancy: this is your doing? |
| 16:54 | technomancy | it is indeed |
| 16:54 | cooldude` | i must say i rather like that |
| 16:55 | technomancy | cooldude`: I like to keep things in as few files as possible as it eases distribution |
| 16:55 | hiredman | technomancy: http://weblogs.java.net/blog/robogeek/archive/2009/01/it_will_be_open.html <-- blog post on the relationship between openjdk and sun's jdk releases |
| 16:55 | technomancy | cooldude`: also want to push it out to the elisp package archive |
| 16:55 | technomancy | hiredman: thanks |
| 16:55 | cooldude` | technomancy: nifty |
| 16:55 | cooldude` | i use billc's clj-build script to get all my clojure stuff at once, so i wanted to just change the repo i use in that script from jochu's to yours |
| 16:56 | Chouser | Fib: not bad. there's no need to put f in the loop, as it can use the original arg |
| 16:56 | Chouser | Fib: no need to quote [] |
| 16:56 | technomancy | cooldude`: jochu has said he's going to pull from mine soon, so that may not be necessary. |
| 16:57 | te | technomancy: did you fork jochu's clojure-mode? |
| 16:57 | technomancy | te: I did |
| 16:57 | cooldude` | well i want it now, so even it might be a temporary change |
| 16:57 | te | technomancy: hehe just checking which i should grab |
| 16:57 | technomancy | cooldude`: but feel free to do whatever. eventually ELPA will be the best place for it |
| 16:57 | technomancy | te: jochu's is the root, but mine is currently more full-featured. |
| 16:57 | Fib | Chouser: thanks |
| 16:59 | Chouser | generally functions that build vectors just return them -- if the user passes it to a seq function (like map, filter, etc.) that'll still work, but it leaves open the option of treating it like a vector. |
| 16:59 | Chouser | Fib: unless you specifically don't want to promise you'll always be returning a vector. |
| 17:00 | Chouser | Fib: and for the record 'map' does essentially the same thing as 'zipWith', but lazily. |
| 17:00 | cooldude` | technomancy: well, it works :) acts weird with some of my macros, but that is probably more my fault for writing weird macros |
| 17:01 | Fib | hmmm |
| 17:01 | te | technomancy: -cp /Users/bc/lisp/clojure/clojure/target/clojure-lang-1.0-SNAPSHOT.jar:/Users/bc/.clojure/*:/Users/bc/lisp/clojure/clojure/target/* \ clojure.lang.Repl |
| 17:01 | te | i dont really understand whats going on with target/* and such there |
| 17:01 | cooldude` | but i'll be back later |
| 17:01 | te | i just want to edit Bill's bash script to work for me |
| 17:01 | te | i dont think i even have a .clojure file yet |
| 17:02 | Fib | Ahh, I see now |
| 17:02 | Chousuke | gah :( |
| 17:02 | Chousuke | why is not egg working |
| 17:02 | technomancy | te: I think he was using an old checkout |
| 17:03 | Chousuke | thinks I wnat to write in the buffer when I press U to push changes to an external repo. |
| 17:03 | technomancy | it used to be if you compiled with maven instead of ant, it would put the jar someplace else |
| 17:03 | technomancy | cooldude`: some of your macros mess up imenu? |
| 17:03 | technomancy | could I see an example? |
| 17:04 | technomancy | te: you don't need a ~/.clojure dir at all |
| 17:04 | te | technomancy: i take it his .clojure/* is where he keeps all of his other jars? |
| 17:04 | te | like swank and such? |
| 17:04 | technomancy | probably not swank since that's not launched from the shell, but other libs, yes |
| 17:04 | te | err nevermind |
| 17:05 | te | okay thanks for the help |
| 17:06 | technomancy | te: command-line interaction is definitely a weak spot in clojure right now |
| 17:07 | rhickey | i.e. (map f coll) ==> (seq (map-stream f coll)) |
| 17:08 | te | technomancy: here is another question for you, sorry |
| 17:08 | drewr | ,(to-array ["foo" "bar"]) |
| 17:08 | clojurebot | #<Object[] [Ljava.lang.Object;@1b7a875> |
| 17:08 | te | (add-to-list 'load-path (concat home-dir ".clojure/swank-clojure")) |
| 17:08 | drewr | How do I get String[]? |
| 17:08 | te | in that instance, if i put swank-clojure/ into .clojure/, will that suffice? |
| 17:09 | te | or is it looking for swank-clojure.el? |
| 17:09 | rhickey | (doc into-array) |
| 17:09 | clojurebot | Returns an array with components set to the values in aseq. The array's component type is type if provided, or the type of the first value in aseq if present, or Object. All values in aseq must be compatible with the component type. Class objects for the primitive types can be obtained using, e.g., Integer/TYPE.; arglists ([aseq] [type aseq]) |
| 17:09 | lisppaste8 | technomancy pasted "clojure slime setup" at http://paste.lisp.org/display/73992 |
| 17:09 | technomancy | te: just pasted what I use |
| 17:09 | technomancy | I keep swank-clojure in ~/src |
| 17:09 | drewr | rhickey: Thanks. |
| 17:10 | te | the whole directory containing swank-clojure.el and swank-clojure.autoload.el? |
| 17:10 | te | or just those files? |
| 17:10 | rhickey | drewr: since you have uniform types you don't need to pass a type |
| 17:10 | technomancy | te: the whole git checkout of the swank-clojure repo |
| 17:10 | te | okay that was my issue |
| 17:10 | te | thanks for the paste |
| 17:10 | technomancy | no problem |
| 17:11 | technomancy | te: I'm currently working on a commercial screencast for Clojure that will definitely cover this kind of thing |
| 17:12 | technomancy | though a blog post wouldn't hurt. clementson's is kind of complicated because he wants to support CL at the same time as clojure |
| 17:13 | te | yeah i just want to get started with slime + emacs lickity split |
| 17:13 | te | slime + emacs + clojure of course |
| 17:14 | technomancy | te: the problem with installing stuff manually is that there's no guessable location for these kinds of things, so you can't just toss some code out for other folks to use; it's always going to require a bit of tweaking |
| 17:15 | te | yeah that's a bummer, but a necessary evil i suppose |
| 17:15 | te | portability is a bitch like that |
| 17:15 | technomancy | if I may toot my own horn a bit, you might benefit from the Emacs PeepCode (http://peepcode.com/products/meet-emacs) as well as the Starter Kit (http://github.com/technomancy/emacs-starter-kit.git) |
| 17:16 | te | technomancy: im struggling to remember what ive used of yours |
| 17:16 | technomancy | because of that "not sure where to look" problem, swank-clojure doesn't come with the starter kit, but if you do the checkout and use the code from my paste, you should be good. |
| 17:16 | te | that was simply bad ass |
| 17:16 | te | ticgit? |
| 17:16 | te | ditz? |
| 17:16 | technomancy | I played with ditz for a while, but I never ended up contributing any code to it. |
| 17:16 | te | github* |
| 17:17 | technomancy | my favourite misspelling is "guthub" |
| 17:17 | technomancy | I had a ditz fork for a while, so you may have used that thinking I wrote it. |
| 17:18 | technomancy | most of my interesting stuff is elisp, though there are some small ruby tools too |
| 17:18 | te | yeah i think it was the preferred fork for awhile |
| 17:18 | te | anyway, i liked ditz a lot |
| 17:18 | te | havent had much use for it recently |
| 17:18 | technomancy | I should keep forks like that around if people are going to think that I wrote them. =) |
| 17:18 | te | haha |
| 17:19 | te | technomancy: i just may buy that peepcode cast |
| 17:19 | te | i really need to learn emacs |
| 17:19 | te | i spent a lot of time with textmate and vim, always negelcted emacs |
| 17:19 | te | but lately i want to do lisp and now clojure |
| 17:19 | te | its just a good editor to know enough to use |
| 17:21 | icey | te: i just bought the peepcode screencast recently; it's good (it was easier for me to learn from than using Learning GNU Emacs) |
| 17:21 | technomancy | I don't have anything against vim, but I think eventually you need to get your hands dirty and modify the behaviour of the editor. And I like Lisp. =) |
| 17:21 | te | :) |
| 17:22 | icey | I'm a vim guy, but it kind of comes down to the fact that pretty well everything lispy is just better in emacs. |
| 17:22 | technomancy | some day when I have a lot of time on my hands I'm going to sit down and give modal editing a try. |
| 17:22 | fffej | i'm trying to work out why I can use things like clojure.contrib in my emacs - I've got swank-clojure-extra-classpaths set to contain clojure-contrib.jar, my class path definitely contains it - have I missed something? |
| 17:23 | fffej | (can means can't!) |
| 17:23 | technomancy | fffej: does it blow up when you try to require it? |
| 17:23 | technomancy | also: did you set swank-clojure-extra-classpaths *before* starting SLIME? |
| 17:24 | fffej | technomancy: it does blow up with "(setq swank-clojure-extra-classpaths '("~/src/clojure-contrib/clojure-contrib.jar"))" when I use it - let me paste my .emacs to the bin |
| 17:24 | te | icey: send me the emacs cast |
| 17:24 | te | ;) |
| 17:25 | technomancy | fffej: what do you mean "when I use it"? when you hit M-x slime or when you eval something like (require 'clojure.contrib.duck-streams) |
| 17:25 | te | i kid, just truthfully broke |
| 17:25 | lisppaste8 | fffej pasted "broken .emacs" at http://paste.lisp.org/display/73993 |
| 17:25 | icey | te: i bet you could sell pens at the interstate offramp and make nine bucks; it's not very expensive |
| 17:25 | fffej | technomancy: i mean when I evaluate some code that uses it, starting slime is fine |
| 17:25 | technomancy | heh. I'm watching you, te |
| 17:25 | te | :D |
| 17:26 | te | deposits* |
| 17:26 | te | :) |
| 17:26 | danlarkin_ | rhickey: I have another question about the CA :) "your company's name (if applicable)" |
| 17:26 | danlarkin_ | rhickey: when is it applicable |
| 17:26 | danlarkin_ | if they're sponsoring my work? |
| 17:27 | technomancy | te: thanks! I think you'll get your money's worth. =) |
| 17:27 | rhickey | danlarkin_: right |
| 17:27 | technomancy | the "contributing" page on clojure.org says you should include your sourceforge username with your CA; should that read Google Code now? |
| 17:27 | danlarkin_ | rhickey: ok, thanks. Mailing tonight! |
| 17:29 | Chouser | rhickey: that's really cool about 'map'. Now you can just drop the 'seq' part and find out how life without punning feel. |
| 17:29 | te | technomancy: purchased :) |
| 17:29 | technomancy | te: if I'm not around, the #emacs channel is usually pretty helpful too |
| 17:30 | te | nod -- you're more helpful than most though to be honest |
| 17:30 | te | too many zealots, not enough irc servers |
| 17:32 | te | anyway, thanks for the help everyone |
| 17:32 | te | i need to go to chinese, but ill be back later to ask more and more questions as i actually begin to code some clojure |
| 17:32 | te | ;) |
| 17:32 | ecret | is it possible to see the jars loaded in the vm when clojure is running? I am using emacs swank so I am having issues getting jars included since i am not starting clojure with the standard java -cp classpaths line |
| 17:32 | technomancy | te: well I *am* making money off it, so it's not just a Goodness of the Heart thing =) |
| 17:32 | fffej | I don't suppose I could sponge some generosity - I'm still stuck with getting slime to find my JAR Files :( |
| 17:33 | te | technomancy: meh, teaching is a service seldom compensated to the degree it ought to be IMHO |
| 17:33 | hiredman | ecret: you can check the classpath |
| 17:33 | te | appreciation for those who do it regardless is as important as paying for their services |
| 17:34 | hiredman | (System/getProperty "java.class.path") |
| 17:34 | hiredman | but that is not all inclusive |
| 17:34 | technomancy | fffej: can you paste the code that gives the error? |
| 17:34 | rhickey | technomancy: contributors page fixed - thanks |
| 17:35 | fffej | sure, it's the compojure getting started guide - http://en.wikibooks.org/wiki/Compojure/Getting_Started (the one called hello.clj) |
| 17:36 | technomancy | fffej: so it's the "use" part that is causing the problem? |
| 17:36 | hiredman | haha |
| 17:36 | hiredman | the anti-lisp |
| 17:36 | hiredman | wait |
| 17:36 | hiredman | X-sharp, but it runs on the jvm |
| 17:36 | fffej | technomancy: yeah, that causes "NoClassDEfFoundError" - I've checked (System/getProperty "java.class.path") and that contains all the Jar's I'm aiming for |
| 17:36 | rhickey | Chouser: I tried that, it didn't feel too great |
| 17:36 | te | XML-oriented |
| 17:37 | lisppaste8 | technomancy pasted "compojure launch from slime" at http://paste.lisp.org/display/73997 |
| 17:37 | technomancy | fffej: that's what I use to launch my compojure app from slime |
| 17:37 | technomancy | I keep all the required jars in jars/ in the application root |
| 17:37 | hiredman | fffej: the getting started guide could be old |
| 17:37 | fffej | thanks all - I'll give it a try and see if it works |
| 17:38 | ecret | i have pretty much the same issue as technomancy |
| 17:38 | rhickey | Chouser: some of the pain is the punning, other is the difference in type, things checking for ISeq |
| 17:39 | technomancy | ecret: try adapting that paste to your app; be sure to launch a new instance so you don't have an old slime laying around |
| 17:39 | rhickey | Chouser: I have to find a recipe for exploring this without getting overwhelmed by a ton of breakage |
| 17:41 | jli | rhickey, I think the license page on clojure.org is out of date now, right? http://clojure.org/license |
| 17:42 | Chouser | rhickey: ooh, ISeq, yeah. |
| 17:42 | rhickey | jli: fixed - thanks |
| 17:42 | jli | well that was fast :) |
| 17:44 | technomancy | rhickey: while you're at it, the footer copyright still says 2008 |
| 17:45 | stuarthalloway | ecret: classspath-url-seq at http://github.com/stuarthalloway/programming-clojure/blob/87bd317882f9d3d31df757272984ee93fd535234/examples/utils.clj |
| 17:45 | walters | rhickey: interesting, so eos is passed explicitly now instead of just being RT.eos() ? |
| 17:45 | stuarthalloway | r/sss/ss |
| 17:46 | rhickey | walters: yes, the canonic sentinel is not that great, too easy to get in the stream of values |
| 17:46 | rhickey | walters: in chaining situations |
| 17:46 | stuarthalloway | fffej: the programming clojure project has a clojure+contrib+compojure+jetty preloaded |
| 17:46 | walters | rhickey: yeah, that was my concern with it; e.g. if you were reflecting on RT, or using Clojure inside a debugging session |
| 17:47 | rhickey | walters: also, things like (map next! ...) break |
| 17:47 | walters | ah, right |
| 17:47 | fffej | :stuarthalloway thanks, I'll take a look |
| 17:47 | technomancy | stuarthalloway: all that stuff loaded from slime? |
| 17:48 | stuarthalloway | technomancy: No. I have resolutely ignored slime because of the churn |
| 17:48 | technomancy | stuarthalloway: yeah, it is a shame they don't do Real Releases =\ |
| 17:48 | stuarthalloway | although the classpath-url-seq might be some help troubleshooting it... |
| 17:49 | stuarthalloway | when the book is done I might create a website with some pointers for environment setup -- it seems a waste to commit that stuff to dead trees |
| 17:50 | technomancy | that's true; totally makes sense given the medium |
| 17:50 | Lau_of_DK | Gentlemen, I'd just like to correct something from our earlier Vim vs Emacs discussion, as Ive been made aware that certain points could easily be taken the wrong way: I didnt not mean to flame Vim-users nor the author of Gorilla or any of those tools, there was no harm meant whatsoever. I really enjoy the friendly and helpful tone of this channel and want to contribute to keeping it that way. I'll try to be more clear in the future. |
| 17:50 | walters | rhickey: are you planning to change IStream? |
| 17:50 | rhickey | walters: IStream? |
| 17:51 | walters | the Java interface |
| 17:51 | rhickey | walters: gone |
| 17:51 | walters | oh, i was looking at some cached version of svn somehow |
| 17:51 | drewr | Is there a builtin or contrib that will do map-val on a hashmap? |
| 17:51 | LordOfTheNoobs | rhickey: I just started looking at clojure a couple days ago. This thing is pretty fantastic from what I've seen so far. Thanks for sharing it. |
| 17:51 | technomancy | stuarthalloway: I found for the Emacs screencast having the Starter Kit as a supplement was a huge help |
| 17:52 | rhickey | walters: It ends up the semantics of stream are so complex, no implementation could significantly differ, so just a concrete class |
| 17:52 | walters | interesting |
| 17:52 | technomancy | stuarthalloway: I wonder if clojure-in-a-box could function similarly for the book. |
| 17:52 | stuarthalloway | technomancy: yes, I think you are right |
| 17:52 | drewr | (map-val #(.toUpperCase %) {:foo "foo" :bar "bar"}) => {:foo "FOO" :bar "BAR"} |
| 17:52 | stuarthalloway | but it is a timing issue |
| 17:52 | rhickey | LordOfTheNoobs: thanks, and you're welcome! |
| 17:52 | achim_p | rhickey: there seems to be a problem with *io-context* being private but used in macros in the latest svn rev (streams branch): |
| 17:52 | achim_p | user=> (dosync (ref-set (ref 0) 1)) |
| 17:52 | achim_p | java.lang.IllegalStateException: var: clojure.core/*io-context* is not public (NO_SOURCE_FILE:1) |
| 17:52 | technomancy | Lau_of_DK: thanks for clearing that up. =) |
| 17:53 | stuarthalloway | technomancy: if I had written Clojure-in-a-box in September 08 and tried to keep it up to date I don't know if I would have done anything else! :-) |
| 17:53 | rhickey | achim_p: ack, will fix - that's halfway changed over to new scope stuff |
| 17:53 | technomancy | stuarthalloway: heh |
| 17:54 | Chousuke | drewr: hmm? |
| 17:54 | technomancy | one thing that would help tremendously is if swank-clojure could provide "last known good" revisions that it's been tested with |
| 17:54 | achim_p | rhickey: thanks! |
| 17:54 | hiredman | you could tell clojurebot what the last known good setup is :P |
| 17:54 | Chousuke | drewr: did you take erc as your repl buffer or something? :P |
| 17:54 | ecret | hiredman, stuarthalloway it does work now thanks |
| 17:54 | drewr | Chousuke: No, I asked a question. :-) |
| 17:54 | fffej | technomancy: amen to that - i've made some progress (:use [compojure jetty html]) now works, but I still can't get compojure.http servlet to work. |
| 17:55 | Chousuke | drewr: ah, I missed that. |
| 17:56 | technomancy | fffej: speaking of last known good, you could try using all the jars from stuarthalloway's repo; it could be that compojure hasn't been updated or something like that? |
| 17:56 | technomancy | servlets aren't quite my area of expertise |
| 17:57 | stuarthalloway | fffej: I try to keep the various jars in sync, and the (growing) test suite for the book passing. If that isn't true let me know |
| 17:57 | rhickey | achim_p: fixed rev 1222 |
| 17:57 | rhickey | made public for now |
| 17:58 | fffej | technomancy: I could do.. However, I'm paranoid that once I change something with my Emacs/Slime set up I'll never get it working again :) At least now (with your help) I can include clojure.contrib. I'll perhaps try it with a fresh brain in the morning |
| 17:58 | technomancy | clojurebot: latest? |
| 17:58 | clojurebot | latest is 1221 |
| 17:58 | technomancy | fffej: right; if you check your jars into git you can always go back to them. |
| 17:58 | technomancy | that'll help you feel a little more confident about experimenting |
| 17:58 | duck1123 | fffej: configuring emacs is the same as forking emacs... use source control |
| 17:59 | technomancy | so true. configuration is code, even if you don't realize it. |
| 17:59 | hiredman | I think clojurebot's svn checker dies due to oom |
| 17:59 | fffej | tis a good plan, i'll give it a go now |
| 18:00 | technomancy | hiredman: oom? |
| 18:00 | technomancy | out of memory, right |
| 18:00 | hiredman | out of memory |
| 18:00 | technomancy | too much XML? |
| 18:00 | hiredman | nah, limited jvm |
| 18:00 | Chousuke | maybe it hsould be refactored to use some svn lib anyway :/ |
| 18:01 | Chousuke | hiredman: did I break your pqueue by implementing it with sort btw? |
| 18:01 | clojurebot | svn rev 1222; made AStream Sequential made *io-context* public |
| 18:01 | hiredman | Chousuke: haven't checkout that yet |
| 18:02 | Chousuke | hiredman: I couldn't understand your implementation so I rewrote it :P |
| 18:02 | hiredman | Chousuke: you did forget to change one instance of "x" to "pq" :P |
| 18:02 | hiredman | Chousuke: well neither did I, good job |
| 18:03 | fffej | stuarthalloway: I checked out the programming-clojure and ran the tests, should I expect a couple of failures (test-add-message-with-backup) and (run-demos) |
| 18:03 | Chousuke | a java priority queue might be even better but that's evil and mutable. |
| 18:03 | hiredman | your conj is nice and simple |
| 18:04 | achim_p | rhickey: perfect, thanks, slime starts up again |
| 18:04 | stuarthalloway | fffej: hmmm. no |
| 18:06 | stuarthalloway | fffej: can you post a stack trace to http://paste.lisp.org/? |
| 18:07 | fffej | stuart: http://paste.lisp.org/display/74000 - looks like both are file io, so possibly something environmental my side |
| 18:07 | stuarthalloway | fffej: got it, fix in a minute |
| 18:08 | cooldude` | woohoo i love emacs keyboard macros |
| 18:09 | stuarthalloway | fffej: I needed to check a file into the output directory so that git would create the dir on your side. Pull it and see if it is fixed now. |
| 18:09 | fffej | stuarthalloway: sweet, clean run through now |
| 18:09 | technomancy | ah, the good old .gitignore files |
| 18:10 | technomancy | bites everyone. =) |
| 18:10 | fffej | stuarthalloway: sweet, clean run through now - thanks |
| 18:11 | stuarthalloway | technomancy: don't badmouth git within earshot of rhickey, we need to win him over :-) |
| 18:11 | technomancy | stuarthalloway: oops! |
| 18:12 | technomancy | (or the test could just check for the existence of the dir) |
| 18:29 | stuhood | hey gang |
| 18:30 | stuhood | i want to flatten a sequence of tuples into a sequence, like: |
| 18:30 | stuhood | ((:a 1) (:b 2) (:c 3)) => (:a 1 :b 2 :c 3) |
| 18:31 | stuhood | or convert that first structure directly to a map, if possible |
| 18:31 | cooldude` | stuhood: (apply concat ...) does the first thing |
| 18:31 | stuhood | ahhh |
| 18:32 | stuhood | that would be (apply hash-map (apply concat ...)) |
| 18:32 | hiredman | ,(reduce #(conj % (first %2) (second %2)) '((:a 1) (:b 2) (:c 3))) |
| 18:32 | clojurebot | (3 :c 2 :b :a 1) |
| 18:32 | cooldude` | lol |
| 18:32 | hiredman | hmmm |
| 18:32 | cooldude` | damnit conj |
| 18:32 | hiredman | oh |
| 18:32 | hiredman | duh |
| 18:32 | hiredman | ,(reduce #(conj % (first %2) (second %2)) {} '((:a 1) (:b 2) (:c 3))) |
| 18:32 | clojurebot | java.lang.IllegalArgumentException: Don't know how to create ISeq from: Keyword |
| 18:33 | stuhood | ,(apply hash-map (apply concat ((:a 1) (:b 2) (:c 3)))) |
| 18:33 | clojurebot | java.lang.NullPointerException |
| 18:33 | hiredman | stuhood: (:a 1) is being evaled to nil |
| 18:34 | stuhood | yea... my example didn't have good syntax |
| 18:35 | stuhood | thanks guys, the apply solution should work |
| 18:35 | hiredman | ,(reduce #(conj % (first %2) (second %2)) {} [[:a 1] [:b 2]) |
| 18:35 | clojurebot | Eval-in-box threw an exception:Unmatched delimiter: ) |
| 18:36 | hiredman | ,(reduce #(conj % (first %2) (second %2)) {} [[:a 1] [:b 2]]) |
| 18:36 | clojurebot | java.lang.IllegalArgumentException: Don't know how to create ISeq from: Keyword |
| 18:36 | cooldude` | lol |
| 18:38 | fffej | has the syntax of ns with :import changed recently? Trying to get compojure to work and muching around with the syntax to be (:import (java.net URL)) rather than (:import java.net.URL) appears to have fixed things |
| 18:40 | technomancy | stuhood: there's a flatten function in seq-utils in contrib |
| 18:41 | stuhood | technomancy: thanks but if (concat ...) is lazy, then i think i'll be happy with it, and avoid the extra dependency |
| 18:42 | stuhood | haha |
| 18:42 | technomancy | btw, would people find it useful if flatten took an optional integer arg to specify how many levels to flatten? |
| 18:44 | stuhood | technomancy: can't hurt? |
| 18:45 | technomancy | well, if nobody's going to use it but me then might as well keep it simple |
| 19:02 | scottj | Did the if enhancement that made it like cond get removed? I'm getting an error saying too many arguments when I pass it 5 |
| 19:03 | cooldude` | scottj: might need some vectors, idk |
| 19:05 | cooldude` | now we can parse dates too: http://gist.github.com/49656 |
| 19:06 | cooldude` | clojure.contrib.date: now with macro love! |
| 19:08 | technomancy | cooldude`: nice! by the time I get back to my web app that was using dates, that will be in contrib and I'll be humming along painlessly. |
| 19:08 | cooldude` | woo! |
| 19:09 | cooldude` | the best part is you can really easily define your own named formats |
| 19:09 | technomancy | good; I do that pretty frequently in Ruby |
| 19:09 | cooldude` | i'm very happy with this code :) |
| 19:10 | technomancy | cooldude`: have you talked to anyone about getting it into contrib? unfortunately me thinking it's a good idea won't quite get you there. |
| 19:10 | cooldude` | not yet, but its ready to drop-in, look at the namespace |
| 19:10 | technomancy | right |
| 19:10 | technomancy | I liked the docstrings in mine better, but this is probably more appropriate. =) |
| 19:10 | cooldude` | i'm about to make a change to the syntax of the macros to make them nicer |
| 19:11 | cooldude` | and more consistent |
| 19:11 | technomancy | good thing no one is using it yet. =) |
| 19:11 | cooldude` | lol it's 2 days old, i can change whatever i want |
| 19:11 | technomancy | that's a nice feeling. |
| 19:11 | technomancy | just remember it won't last forever. =) |
| 19:11 | cooldude` | lol |
| 19:11 | cooldude` | yeah |
| 19:12 | cooldude` | maybe i should combine parsers and formatters, yes? |
| 19:13 | cooldude` | at least from the macro end |
| 20:01 | cads | I'd like to write a program for writing a representation of a tree, and I'd like to write it in clojure as my first lisp program, as opposed to using cl or scheme. My pseudocode is simple enough that I could write the program easily in ruby or haskell, but I was wondering where I should look for a little clojure tutorial covering the programming environment and some of the functions for dealing with strings and nested lists, and such |
| 20:02 | technomancy | clojurebot: clojure-in-a-box? |
| 20:02 | clojurebot | clojure is a very attractive hammer with a nice heft to it |
| 20:02 | technomancy | cads: I've heard good things about clojure-in-a-box |
| 20:02 | technomancy | cads: there's a thread on the mailing list about this very topic too |
| 20:02 | cads | cool |
| 20:03 | cads | it feels like there's very little I'd need to bootstrap myself, and that the community might have like one canonical tutorial |
| 20:04 | technomancy | cads: well the classpath can be confusing at first |
| 20:04 | technomancy | do you have an editor preference? |
| 20:05 | cads | I have not yet played with clojure because of my reluctance to play with emacs |
| 20:05 | cads | but I'll get over it, I'd really like to be able to use emacs' power |
| 20:05 | cads | I used gedit, otherwise |
| 20:06 | technomancy | hmm; I don't think gedit is supported. |
| 20:06 | technomancy | clojure-in-a-box comes pre-configured with emacs and clojure supposedly |
| 20:06 | technomancy | haven't used it myself since I'm pretty comfortable with Emacs already |
| 20:06 | cads | brb |
| 20:07 | cads | can't find clojure in a box's project page |
| 20:08 | technomancy | oh... clojurebox is windows only; sorry. |
| 20:08 | technomancy | should do my research. =\ |
| 20:08 | cads | I think I can seriously get over having to use emacs, especially if all I need to learn is how to make a new buffer and involve a REPL |
| 20:09 | technomancy | cads: who knows, it may grow on you with time. =) |
| 20:09 | technomancy | being able to modify the behaviour of your environment at runtime is addictive |
| 20:09 | cads | I know I'd love to have custom macros for text editing, so far the only problem has been time |
| 20:09 | technomancy | custom macros are only the beginning |
| 20:10 | technomancy | =) |
| 20:10 | cads | hehe, I've heard emacs called the lisp operating system |
| 20:10 | technomancy | (some people think that's a joke, but it's actually true) |
| 20:11 | technomancy | cads: you're like the fourth person to come in here today asking about this... I think I'll have to write a blog post about it. |
| 20:11 | technomancy | since it's really not clear how to set things up if you don't know Emacs |
| 20:11 | cads | well, I think for many people interested in clojure, emacs will be a new thing |
| 20:11 | technomancy | true |
| 20:12 | technomancy | everyone who's not already a Smug Lisp Weenie(TM) anyway |
| 20:13 | cads | I have a deep respect for emacs and its powerful architecture, just that the learning curve hasn't been anything I've had the time to climb |
| 20:13 | technomancy | understandable |
| 20:14 | cads | it's been a matter of learning emacs in order to use haskell mode or SLIME or clojure mode, and I've spent time just learning the language and emacs fell by the wayside |
| 20:15 | cads | which is why I think a tutorial that would bootstrap you into a emacs/clojure environment would be a big plus |
| 20:15 | technomancy | cads: don't tell anyone, but I've got something in the works |
| 20:15 | technomancy | it's a commercial screencast (http://peepcode.com) |
| 20:15 | technomancy | just started it this week |
| 20:15 | cads | haha |
| 20:15 | cads | cool |
| 20:16 | technomancy | I've got one on Emacs (no clojure involved) too, but you might want to wait for the clojure one. |
| 20:16 | cads | it'll be nice to know it's out there |
| 20:16 | cads | i think i'll just jump on an emacs tutorial |
| 20:17 | technomancy | cool |
| 20:17 | technomancy | i'm hoping to have the clojure one out in early Feb. hopefully 1.0 is released by then. |
| 20:17 | cads | link me to your blog? |
| 20:18 | technomancy | http://technomancy.us |
| 20:18 | cads | you seem to be in the know |
| 20:18 | technomancy | well I'm pretty new to clojure, but I've done a lot of lisp in the past |
| 20:19 | technomancy | mostly get paid to do Ruby, which is more lisp-like than you'd think |
| 20:19 | cads | ruby is addictive |
| 20:19 | technomancy | heh |
| 20:19 | technomancy | I'm having more fun with clojure these days. Loving how FP turns your brain inside out. |
| 20:19 | cads | till you hit the wall on computing performance and can't find another language that satisfies your dynamic craving |
| 20:20 | technomancy | can't find another non-lisp language, you mean. =) |
| 20:20 | cads | I'm hoping clojure will be that :D |
| 20:20 | technomancy | definitely feels like that for me. |
| 20:21 | cads | well there are some definite touches of brilliance in ruby, and I'm going to miss some of that really cuddly syntax |
| 20:21 | technomancy | clojure's lambda shorthand is every bit as convenient as ruby blocks IME |
| 20:21 | cads | ruby is much cuddlier than say haskell :D |
| 20:21 | technomancy | (other lisps make you use "lambda", which is a bit long for really small things) |
| 20:22 | technomancy | I need to take off though; good luck getting things figured out. |
| 20:22 | cads | thanks an good luck in your tutorial endeavor |
| 20:22 | technomancy | later |
| 20:27 | gnuvince_ | In streams, if an eos is not explicitly specified, what is the value of eos? |
| 21:06 | cooldude127 | this place is dead, let's see if this question helps: my types are specified like ::Date, ::Time, etc. but i want users to be able to define formatters and parsers for dates that specialize on the type from they're own packages. what's the best way to let them do this, short of specifying types like :clojure.contrib.date/Date ? |
| 21:07 | cooldude127 | can i use (keyword "clojure.contrib.date" "Date") in my macro? |
| 21:08 | cooldude127 | is that anything resembling a good idea? |
| 21:09 | cooldude127 | :( stupid dead channel |
| 21:13 | hiredman | cooldude127: clojuebot's plugin stuff has multimethods that register themselves from different namespaces |
| 21:13 | rhickey | gnuvince: an eos is always explicitly specified by some code |
| 21:13 | cooldude127 | hiredman: what? |
| 21:13 | cooldude127 | hiredman: where is code? |
| 21:13 | hiredman | clojurebot: where are you? |
| 21:14 | clojurebot | http://github.com/hiredman/clojurebot/tree/master |
| 21:14 | cooldude127 | that's awesome |
| 21:14 | rhickey | gnuvince: and you should never care about the value |
| 21:16 | gnuvince_ | I agree about not caring about the value, but it stumped me to see that eos seemed to come out of nowhere. |
| 21:22 | jli | man, why isn't anyone laughing at this guy's jokes? poor guy. http://www.parleys.com/display/PARLEYS/Home#talk=2556139;slide=12;title=The%20future%20will%20be%20about%20programming%20languages |
| 21:26 | dreish | jli: How do you know they aren't? |
| 21:27 | cooldude127 | hiredman: that works because the symbols used to dispatch on are defined in the same package as the defmethod call, i want to use already defined keywords in my own package from others |
| 21:27 | jli | Because you can hear it when they do it a couple of times. And because he talks about how they aren't laughing. |
| 21:34 | cooldude127 | 1d6 |
| 21:34 | clojurebot | 3 |
| 21:34 | cooldude127 | lol clojurebot rolls dice |
| 21:34 | cooldude127 | 3d6 |
| 21:35 | clojurebot | 5 |
| 21:35 | cooldude127 | 3d6 |
| 21:35 | clojurebot | 11 |
| 21:35 | cooldude127 | 3d6 |
| 21:35 | clojurebot | 5 |
| 21:47 | te | I'm baccckkkk |
| 21:47 | cooldude127 | wooooo |
| 21:47 | te | haha |
| 21:47 | te | clojurebot: paste |
| 21:47 | clojurebot | paste is http://paste.lisp.org/new/clojure |
| 21:49 | cooldude127 | simple question: how do i get the unqualified name of a keyword? basically: :clojure.contrib.date/Date -> "Date" |
| 21:50 | hiredman | ,(name :clojure.contrib.date/Date) |
| 21:50 | clojurebot | "Date" |
| 21:50 | hiredman | ? |
| 21:50 | cooldude127 | i honestly didn't expect it to be THAT simple |
| 21:50 | hiredman | ,(namespace :clojure.contrib.date/Date) |
| 21:50 | clojurebot | "clojure.contrib.date" |
| 21:50 | cooldude127 | sweet |
| 21:56 | te | cooldude127: could you give me a couple lines to test emacs with |
| 21:56 | te | i have swank/slime setup |
| 21:57 | te | and id like to make sure its all working, because it seemed to just switch back to lisp |
| 21:57 | cooldude127 | te: just a minute |
| 21:57 | te | no problem |
| 21:57 | cooldude127 | :) |
| 21:57 | te | i need to learn emacs and clojure, i just want to make sure my environment is working before i continue |
| 21:58 | cooldude127 | te: real quick try *ns* |
| 21:58 | te | #<Namespace user> |
| 21:59 | cooldude127 | te: i think you're in good shape, want to test if clojure-contrib is working? |
| 21:59 | te | yes please |
| 21:59 | cooldude127 | (use 'clojure.contrib.def) |
| 21:59 | te | would also be nice to try something that spans a couple lines to make sure its indenting properly |
| 21:59 | te | returns nil |
| 21:59 | cooldude127 | te: that's right. no error |
| 22:00 | cooldude127 | te: for indentation, just try to write a simple function |
| 22:06 | te | indentation seems to not be working as planned |
| 22:07 | te | (defn hello [name]\n(str "hello, " name)) |
| 22:07 | te | doesnt seem to indent on the 2nd line |
| 22:09 | te | Anyone know? |
| 22:11 | arbscht_ | by \n do you mean `RET' in emacs? |
| 22:11 | te | yes |
| 22:11 | arbscht_ | that won't usually indent. try C-j |
| 22:11 | Cark | press the tab key to indent |
| 22:12 | hiredman | shouldn't it aut-indent? |
| 22:12 | te | ^^that's what i was getting at |
| 22:12 | arbscht_ | typically C-j auto indents |
| 22:12 | arbscht_ | you can swap those bindings around, of course |
| 22:12 | te | doesnt seem to be working |
| 22:13 | arbscht_ | is the buffer in clojure-mode? |
| 22:13 | te | yes |
| 22:13 | te | im removing my apt-get slime and cl-swank |
| 22:13 | te | maybe thats borking something |
| 22:14 | te | C-j works now |
| 22:14 | te | but I don't get the cool prompt that materializes from thin air |
| 22:14 | hiredman | clojurebot: emacs? |
| 22:14 | clojurebot | "Learning Emacs and SLIME was just about the most painful computer experience I've ever been through." |
| 22:14 | te | lol |
| 22:14 | arbscht_ | it's totally worth it :) |
| 22:14 | te | im excited as hell :P) |
| 22:15 | te | ive written hello world, so im well on my way to mastery |
| 22:15 | te | ;) |
| 22:16 | te | http://12monkeys.co.uk/2009/01/21/the-future-of-lisp.html |
| 22:16 | te | not what you think... |
| 22:19 | gnuvince_ | That,s pretty much what I thought ;) |
| 22:19 | gnuvince_ | And I agree |
| 22:19 | gnuvince_ | Although I'd extend that to all languages that are not already mainstream (or nearly mainstream) |
| 22:20 | hiredman | or just "all languages" |
| 22:21 | te | gnuvince_: ive read about 100 times, (so it may just be fashionable right now, but i digress), that lisp will never gain general acceptance due to the strict reliance on emacs/slime |
| 22:21 | gnuvince_ | I would argue that C++ does not need a platform to gain access to a lot of libraries. |
| 22:21 | te | ^ |
| 22:21 | durka42 | oh that's what LFE stands for! |
| 22:22 | gnuvince_ | Some languages (like Haskell) are somewhere in between: a good amount of libraries, but not a critical mass |
| 22:22 | te | haskell is very cool |
| 22:22 | jbondeson | haskell suffers from having academic rather than commercial backing |
| 22:22 | gnuvince_ | I don't think it suffers. |
| 22:23 | Nafai | jbondeson: Not in the slightest |
| 22:23 | gnuvince_ | They've just recently passed the 1,000 packages mark on Hackage, which is impressive. |
| 22:23 | Nafai | Look at major languages with commercial backing: Java, VB, C# |
| 22:23 | Nafai | Sure they are used a lot |
| 22:23 | Nafai | But do you want to be them? :) |
| 22:24 | jbondeson | haha |
| 22:24 | jbondeson | now you're arguing value vs. acceptance |
| 22:24 | gnuvince_ | Plus, the Haskell folks are quite happy to "avoid success at all cost" |
| 22:24 | Nafai | Yeah, Haskell is doing quite well |
| 22:24 | te | i think that's kind of a quirky, cool community mantra |
| 22:24 | gnuvince_ | These days, I play around with Clojure and Haskell. |
| 22:24 | te | that i think takes some of the pressure off the community at large |
| 22:25 | jbondeson | it's doing well in non-commercial sectors. |
| 22:25 | Nafai | gnuvince_: That's about where I'm at |
| 22:25 | gnuvince_ | I try to give priority to Clojure, because that would be more helpful (know Java libs for one thing) |
| 22:25 | jbondeson | you don't see a ton of business use for it (e.g. jobs created) |
| 22:25 | gnuvince_ | But I always have this craving to use Haskell too :) |
| 22:25 | te | jbondeson: yeah, not yet, im not sure what to think of that |
| 22:25 | te | perhaps the problem is that people who actually know shit like haskell, clojure, etc. are just too expensive |
| 22:25 | gnuvince_ | jbondeson: there are some jobs, but they're in niche markets |
| 22:25 | jbondeson | hard to convince people that "pure" function is viable. |
| 22:26 | te | you need to attract a lot of crappy programmers to bring down the cost of implementing the language |
| 22:26 | gnuvince_ | high assurance software (Galois), banking (Credit Suisse), etc. |
| 22:26 | jbondeson | hell if i show some of my coworkers any clojure code their eyes glaze over and they strart mumbling about the slumbering elder gods |
| 22:26 | gnuvince_ | I liked the post of the fellow who said that Haskell was beyond ready for prime time |
| 22:26 | gnuvince_ | I agreed with him |
| 22:26 | te | regardless of whether or not haskell, clojure, et al become widely accepted, they are a healthy "third party" that encourages pythons, rubys, perls, etc. to adopt the same functionality |
| 22:27 | te | i cant see that as a bad thing |
| 22:27 | gnuvince_ | Great compiler, growing library, great community |
| 22:27 | Nafai | te: Agreed in that regards |
| 22:27 | te | yeah gnuvince_ i definitely agree |
| 22:27 | blbrown | what up clojure people |
| 22:27 | gnuvince_ | blbrown: hello |
| 22:27 | te | OMG -- We all are agreeing on stuff! |
| 22:27 | te | This is definitely a healthy community. heh |
| 22:27 | jbondeson | haskell has all the tools to be prime time, it just lacks marketing. |
| 22:28 | gnuvince_ | They need to stop being lazy and evaluate which is the best new logo submission ;) |
| 22:28 | gnuvince_ | But more importantly, they just need to write code. |
| 22:29 | hiredman | clojurebot: haskell? |
| 22:29 | clojurebot | Yo dawg, I heard you like Haskell, so I put a lazy thunk inside a lazy thunk so you don't have to compute while you compute. |
| 22:29 | gnuvince_ | Eventually something's gonna stick (like Rails for Ruby) |
| 22:29 | gnuvince_ | hahahaa |
| 22:29 | gnuvince_ | Nice one :) |
| 22:29 | jbondeson | ugh RoR. |
| 22:29 | te | I have a dirty secret |
| 22:29 | te | I drank the Ruby kool aid |
| 22:29 | jbondeson | =/ |
| 22:30 | Chouser | durka42: LFE around here often mean Left Folding Enumerator, not Lisp Flavoured Erlang |
| 22:30 | te | I know... :\ I see the error of my ways |
| 22:30 | gnuvince_ | jbondeson: not saying RoR is good (cause it's not IMO), but it's what took Ruby from unknown programming language to semi-mainstream |
| 22:30 | te | However I must say the Ruby community is encouraging people to try Haskell, Lisp, etc. |
| 22:30 | te | which is damn healthy AFAIC |
| 22:30 | gnuvince_ | te: I wrote one of the first RoR tutorials ;) |
| 22:31 | jbondeson | not going to deny that, it just shows you what you need to get critical mass, and then you ask yourself "do i want that?" |
| 22:31 | gnuvince_ | te: http://mirror.monsson.dk/rails/tutorial.html |
| 22:31 | gnuvince_ | That was me ;) |
| 22:32 | te | Ruby on Rails was poisoned by the idea RoR could be a marketable framework |
| 22:32 | gnuvince_ | Rarity of a skill means it's well paid (if it's sought after) |
| 22:32 | durka42 | Chouser: that makes sense too |
| 22:32 | durka42 | :) |
| 22:33 | te | how do I modify the look of the user=> prompt in swank-clojure? |
| 22:33 | hiredman | user is the namespace you are in |
| 22:33 | jli | (in-ns 'not-user) |
| 22:33 | jbondeson | haha |
| 22:34 | te | lol |
| 22:34 | arbscht_ | te: have you loaded slime-repl? |
| 22:34 | jbondeson | (in-ns 'clojure-rocks) ? |
| 22:34 | te | arbscht_: yes |
| 22:34 | jbondeson | true then it looks like "user>" |
| 22:34 | te | jli: jbondeson: i was talking more about the style of the prompt |
| 22:34 | hiredman | maybe the next version of clojure.main will let you bling up the repl |
| 22:34 | duck1123 | too bad 'clojure-rocks isn't a valid ns |
| 22:34 | te | as in the color |
| 22:34 | jbondeson | aw |
| 22:35 | hiredman | duck1123: eh? |
| 22:35 | jli | your repl prompt is colored? |
| 22:35 | arbscht_ | te: that looks like the inferior-lisp prompt, not the slime-repl prompt |
| 22:35 | hiredman | ,(in-ns 'clojure-rocks) |
| 22:35 | clojurebot | #<Namespace clojure-rocks> |
| 22:35 | jbondeson | clojure-rocks seems to work for me... |
| 22:35 | duck1123 | 'clojure.rocks works, but that would be something different |
| 22:35 | duck1123 | you can in-ns it, but don't namespaces need 2 parts? |
| 22:35 | te | jli: yes |
| 22:36 | te | arbscht_: ah |
| 22:36 | hiredman | duck1123: user has only one part :P |
| 22:36 | jli | te, if you updated slime recently, you need to load the slime-repl or slime-fancy contrib thingies |
| 22:37 | jbondeson | jli is right, that one caught me off guard since i hadn't updated in quite a while |
| 22:37 | te | i just pulled down the new repo of slime |
| 22:37 | te | thats all im running with i believe |
| 22:38 | durka42 | te: give up on vim? |
| 22:38 | jli | te, what's in your emacs config? you can use something like "(slime-setup '(slime-fancy))" to get the nicer repl |
| 22:38 | te | durka42: yeah |
| 22:38 | gnuvince_ | Hehehe: I hang on a general programming channel (french speaking) and whenever people talk about their threads and mutex and lock problems, I want to tell them to use Clojure :) |
| 22:38 | gnuvince_ | (or Haskell) |
| 22:38 | jli | te, and if you use "(slime-setup '(slime-fancy slime-banner))", you'll impress your friends and attract many potential mates. |
| 22:39 | jbondeson | that worked for you jli? |
| 22:40 | jli | jbondeson, which part? (though everything I've mentioned has worked =)) |
| 22:40 | te | fli |
| 22:40 | Cark | gnuvince you're from france ? |
| 22:40 | te | jli: haha |
| 22:40 | te | jli: unfortunately that doesnt work for me :\ |
| 22:40 | jbondeson | slime attracting mates! cause i feel like even my wife starts shying away from me when i boot up emacs. course that could be the whiskey... hmmm |
| 22:41 | jli | te, hmm, you might also need "(add-hook 'slime-load-hook (lambda () (require 'slime-banner)))" |
| 22:41 | gnuvince_ | Cark: Canada |
| 22:41 | jli | yeah, I think you need that too. |
| 22:41 | Cark | ah belgium here |
| 22:42 | te | Error in init file: Symbol's function definition is void: slime-setup |
| 22:42 | gnuvince_ | Cark: if you want to see what it's like, #programmeur. Most people are Quebecers however, so the channel is usually active between 8AM and 8PM here (which would be +6 for you) |
| 22:42 | jbondeson | did you require slime? |
| 22:42 | te | jbondeson: no not explicitly |
| 22:42 | jli | te, er, you have "(require 'slime)" first, right? |
| 22:42 | te | i didnt need it to get to the repl |
| 22:43 | te | so i didnt know i needed it |
| 22:43 | Cark | gnuvince : i'm a night person as you know =P |
| 22:43 | te | i have it in the load path, and then it autoloads |
| 22:43 | te | perhaps i need those lines after the autoload |
| 22:43 | jli | I don't actually know how any of this works - I just copy configs from Bill Clementson :) |
| 22:43 | jbondeson | i learned how to configure slime the hard way loading different lisps on windows *shudder* |
| 22:44 | te | Error in init file: Symbol's value as variable is void: slime |
| 22:44 | te | grrr |
| 22:45 | jbondeson | add to your load path |
| 22:45 | jli | er, uh, 0_0 did you quote it? |
| 22:45 | jbondeson | oh |
| 22:45 | jbondeson | yeah |
| 22:45 | jbondeson | hah |
| 22:45 | te | yes |
| 22:45 | jbondeson | (require 'slime) ? |
| 22:45 | te | yes |
| 22:46 | jbondeson | ok then make sure you (add-to-list 'load-path "/path/to/slime") |
| 22:46 | te | hm okay i think i fixed it now |
| 22:46 | te | now it gets angry about "You must specify either a swank-clojure-binary' or a `swank-clojure-jar-path' |
| 22:46 | jli | do you have the friend-impressing, date-getting banner animation? |
| 22:46 | te | haha im working on it :) |
| 22:47 | jli | te, http://bc.tech.coop/blog/081023.html |
| 22:47 | te | requiring slime makes it want to load lisp |
| 22:47 | jbondeson | just walk around with your laptop hacking on some clojure in emacs and you'll need a stick to keep em off you |
| 22:47 | te | hahaha |
| 22:48 | jbondeson | next you'll be loading irc into emacs so you can chat here while coding >_> |
| 22:48 | cooldude` | jbondeson: that's what i do |
| 22:49 | cooldude` | code + repl + irc in same window |
| 22:49 | jbondeson | emacs is my os more than anything... |
| 22:49 | te | cooldude`: i cant wait for my day in the sun like that |
| 22:49 | cooldude` | it's awesome :) |
| 22:50 | jli | and sometimes you get confused and use clojurebot for your repl for extended periods of time? |
| 22:50 | jbondeson | just have your os load emacs into full screen and you're good to go |
| 22:53 | cooldude` | jli: honestly have tried to do that before |
| 22:55 | te | i think th eorder of my config is all fscked up |
| 22:55 | te | and thats why its not working right |
| 22:55 | jbondeson | that's easy to do. |
| 22:55 | cooldude` | te: paste it |
| 22:55 | te | clojurebot: url |
| 22:55 | clojurebot | excusez-moi |
| 22:55 | te | clojurebot: paste |
| 22:55 | clojurebot | paste is http://paste.lisp.org/new/clojure |
| 22:56 | lisppaste8 | te pasted "dotemacs" at http://paste.lisp.org/display/74008 |
| 22:56 | te | note that it'd be nice to throw in jli's sexy slime-fancy banner |
| 22:56 | jbondeson | put slime after swank |
| 22:56 | duck1123 | So, are java iterators now streams? (assuming I have that branch) |
| 22:57 | jbondeson | i go: clojure-auto, swank, slime |
| 22:57 | jbondeson | yeah, and rich even fixed the problems in the branch with swank, so it should be good to go. |
| 22:58 | jbondeson | oh, and your clojure config needs to go before the call to auto load |
| 22:59 | cooldude` | jbondeson: you sure about that? |
| 22:59 | jbondeson | pretty, let me double check |
| 23:00 | jbondeson | that's what i do |
| 23:00 | cooldude` | won't the swank-clojure-config function be unbound until you autoload it? |
| 23:00 | jbondeson | hmmm... |
| 23:00 | te | okay looks like i got it working |
| 23:00 | te | thanks everyone |
| 23:00 | te | :) |
| 23:00 | jbondeson | actually, yeah, i use the vars |
| 23:00 | jbondeson | not the config call, good catch |
| 23:01 | cooldude` | yeah |
| 23:01 | cooldude` | all swank-clojure-config does is wrap it in an (eval-after-load |
| 23:02 | jbondeson | The Dude is right. |
| 23:02 | cooldude` | you bet i am |
| 23:02 | jbondeson | though i don't know if he bowls. |
| 23:02 | te | The Dude abides |
| 23:06 | ozy` | you guys, the clojure website is horrible |
| 23:06 | ozy` | someone punch Rich Hickley in the soul for me |
| 23:06 | jbondeson | needs more flash? |
| 23:06 | ozy` | neat language but the documentation is repulsive |
| 23:06 | ozy` | needs more clarity. |
| 23:07 | hiredman | worked fine so far for me |
| 23:07 | Cark | ozy : how is it lacking ? |
| 23:08 | jbondeson | here you go: http://en.wikibooks.org/wiki/Clojure_Programming/Examples/API_Examples |
| 23:08 | jbondeson | rich is busy responding to all the feature/bug requests, so cut him a little slack. |
| 23:09 | ozy` | yeah I'll cut him slack for that |
| 23:11 | jbondeson | there is a ton of user created documentation out there that tends to fill the gap. |
| 23:11 | durka42 | those are some good examples |
| 23:11 | durka42 | clojurebot: examples? |
| 23:11 | clojurebot | Excuse me? |
| 23:11 | durka42 | clojurebot: examples is http://en.wikibooks.org/wiki/Clojure_Programming/Examples/API_Examples |
| 23:11 | clojurebot | In Ordnung |
| 23:11 | durka42 | clojurebot: examples? |
| 23:11 | clojurebot | examples is http://en.wikibooks.org/wiki/Clojure_Programming/Examples/API_Examples |
| 23:15 | jbondeson | one of these days i'm going to figure out what the heck is causing clojure+slime to bring emacs to its knees... |
| 23:29 | te | Whoa I think I actually understand a bit of clojure |
| 23:29 | cooldude` | we're proud of you :) |
| 23:29 | te | lol |
| 23:29 | te | So this idea of functions as passable objects |
| 23:29 | cooldude` | is awesome ? |
| 23:29 | te | Is this where lambda comes in? |
| 23:29 | hiredman | ... |
| 23:29 | hiredman | clojurebot: sicp |
| 23:29 | clojurebot | sicp is http://www.codepoetics.com/wiki/index.php?title=Topics:SICP_in_other_languages:Clojure:Chapter_1 |
| 23:29 | jbondeson | heh |
| 23:29 | cooldude` | well, it's called (fn) in here |
| 23:29 | hiredman | hmm |
| 23:30 | jbondeson | lambda calculus is very, very old |
| 23:30 | hiredman | ,((? [x] x) :a) |
| 23:30 | clojurebot | :a |
| 23:30 | te | im just trying to understand lambda as it relates to clojure |
| 23:30 | jbondeson | even non-lambda functions are passable. |
| 23:30 | te | and im about 2 weeks into calculus I, so forgive me for not knowing |
| 23:30 | jbondeson | functions are just objects that can be evaluated |
| 23:30 | hiredman | te: http://groups.csail.mit.edu/mac/classes/6.001/abelson-sussman-lectures/ |
| 23:31 | hiredman | clojurebot: sicp videos? |
| 23:31 | clojurebot | sicp is http://www.codepoetics.com/wiki/index.php?title=Topics:SICP_in_other_languages:Clojure:Chapter_1 |
| 23:31 | hiredman | clojurebot: sicp videos is http://groups.csail.mit.edu/mac/classes/6.001/abelson-sussman-lectures/ |
| 23:31 | clojurebot | Ack. Ack. |
| 23:32 | durka42 | te: lambda calculus != calculus |
| 23:32 | jbondeson | lambda functioms are just 'anonymous'. usually too simple (or specialized through encapsulation) |
| 23:32 | jbondeson | calculus != calculus =P |
| 23:33 | durka42 | so calculus is NaN? |
| 23:33 | jbondeson | precisely! |
| 23:36 | jbondeson | though to be precise ther is nothing in mathematics that is NaN. we computer scientists just find it easier to ignore the less, shall we say, concrete numbers. |
| 23:36 | hiredman | discrete math++ |
| 23:36 | pjb3 | TCO on the JVM? http://mail.openjdk.java.net/pipermail/mlvm-dev/2009-January/000331.html |
| 23:37 | durka42 | there is no NaN, but there is "don't do that" |
| 23:37 | durka42 | as in 1/0 |
| 23:38 | durka42 | pjb3: that would be nice :) |
| 23:38 | hiredman | ,(/ 1 0) |
| 23:38 | clojurebot | java.lang.ArithmeticException: Divide by zero |
| 23:38 | durka42 | ,(/ 1.0 0.0) |
| 23:38 | clojurebot | java.lang.ArithmeticException: Divide by zero |
| 23:39 | jbondeson | i thought they rejected tail recursion for inclusion. |
| 23:39 | pjb3 | In Ruby 1.0 / 0.0 returns this object Infinity |
| 23:39 | durka42 | this seems like more of a hack tacked on to hotspot than "inclusion" |
| 23:39 | jbondeson | ah |
| 23:39 | hiredman | they said they were not going to do TCO, but someone else stepped up and did it |
| 23:39 | pjb3 | Which I've always thought is weird |
| 23:40 | jbondeson | as long as -1/0 returns object NegativeInfinity |
| 23:40 | jbondeson | and they have a PositiveZero and NegativeZero for limits approaching zero. |
| 23:41 | pjb3 | Yeah, 1.0 / 0.0 # => -Infinity |
| 23:41 | durka42 | ,(* 2 Double/MAX_VALUE) |
| 23:41 | clojurebot | Infinity |
| 23:42 | cooldude` | does clojure-contrib have a string function to turn date-time into DateTime? |
| 23:42 | jbondeson | go go iee floating point spec |
| 23:43 | pjb3 | What's fun to do is stick Infinity into a variable, like inf = 1.0 / 0 |
| 23:43 | pjb3 | then do inf * inf > inf |
| 23:43 | jbondeson | it better return false |
| 23:43 | pjb3 | That would have settled a lot of arguments I had with other kids when I was 8 :) |
| 23:43 | pjb3 | jbondeson: it does |
| 23:43 | durka42 | well, some infinities are bigger than others |
| 23:44 | jbondeson | ... |
| 23:44 | pjb3 | well, not in Ruby, I guess |
| 23:44 | jbondeson | are we going to have to do a proof by contradiction for that durka? >=| |
| 23:45 | pjb3 | ,(let [inf (* 2 Double/MAX_VALUE)] (> (* inf inf) inf)) |
| 23:45 | clojurebot | false |
| 23:45 | ozy` | false in haskell |
| 23:45 | ozy` | (via GMP) |
| 23:47 | ozy` | and in ruby |
| 23:47 | durka42 | http://www.sciencenews.org/view/generic/id/9269/title/Math_Trek__Small_Infinity,_Big_Infinity |
| 23:47 | ozy` | (dunno why it wouldn't be) |
| 23:47 | durka42 | there are infinitely more real numbers than integers, even though there are an infinite number of each |
| 23:47 | durka42 | on the other hand, there are obviously twice as many integers as even integers, but those infinities are the same |
| 23:47 | ozy` | and infinitely more irrationals than rationals |
| 23:48 | hiredman | ozy`: that makes me sad |
| 23:48 | durka42 | real := rational U irrational |
| 23:48 | ozy` | hiredman: how's that? |
| 23:48 | jbondeson | yes, but both are uncountable |
| 23:48 | durka42 | i think cantor counted the rationals |
| 23:48 | hiredman | ozy`:what if the irrationals vote me off the island? |
| 23:49 | durka42 | (in link) |
| 23:49 | ozy` | hiredman: *insert lame joke about a Republican president* |
| 23:50 | jbondeson | only in an abstract way (though what isn't abstract about mathematics) |
| 23:50 | jbondeson | the idea is that integers are the "smallest" set of infinity |
| 23:50 | cooldude` | canonical way to split a string by another string? is it (.split) ? |
| 23:51 | jbondeson | bah, abstract mathematic just make my head hurt. |
| 23:52 | durka42 | hmm |
| 23:52 | durka42 | ,(> Double/POSITIVE_INFINITY Double/NEGATIVE_INFINITY) |
| 23:52 | clojurebot | true |
| 23:52 | durka42 | good :) |
| 23:52 | jbondeson | god i hope so! |
| 23:53 | durka42 | ,(+ Double/POSITIVE_INFINITY Double/NEGATIVE_INFINITY) |
| 23:53 | clojurebot | NaN |
| 23:53 | durka42 | ,(- Double/POSITIVE_INFINITY Double/NEGATIVE_INFINITY) |
| 23:53 | clojurebot | Infinity |
| 23:53 | hiredman | heh |
| 23:53 | durka42 | apparently abs(+inf) > abs(-inf) ? |
| 23:54 | jbondeson | if -infinity and +infinity were countable you should be able to prove whether -inf + inf == 0 |
| 23:54 | durka42 | ,(- Double/NEGATIVE_INFINITY Double/POSITIVE_INFINITY) |
| 23:54 | clojurebot | -Infinity |
| 23:54 | durka42 | ,(+ Double/NEGATIVE_INFINITY Double/POSITIVE_INFINITY) |
| 23:54 | clojurebot | NaN |
| 23:54 | jbondeson | and here i said i was getting away from theoretical math |
| 23:55 | durka42 | i am not sure -inf + inf = 0 |
| 23:55 | hiredman | ,(sort [Double/NEGATIVE_INFINITY Double/POSITIVE_INFINITY]) |
| 23:55 | clojurebot | (-Infinity Infinity) |
| 23:55 | durka42 | like the example about there being twice as many integers as even integers |
| 23:55 | durka42 | but those are both aleph-zero |
| 23:56 | durka42 | but if you added those infinities i wouldn't expect to get zero... |
| 23:56 | durka42 | on the other hand simple intuition doesn't work so well with infinity |
| 23:57 | jbondeson | infinity and zero, concepts that were better left undefined! ;) |
| 23:57 | durka42 | zero is pretty useful :) |
| 23:58 | jbondeson | but think about it |
| 23:58 | jbondeson | what does zero really mean |
| 23:58 | durka42 | the amount of work i am getting done right now |
| 23:59 | jbondeson | speaking of, "Zero: the biography of a dangerous idea" is a good book |