#clojure logs

2009-09-10

04:06LauJensenTop of the morning gents
04:06AWizzArdMoin Lau
04:06AWizzArdGuys, I must be blind. How/Where can I open a new ticket on https://www.assembla.com/spaces/clojure-contrib/ ?
04:09cgrandAWizzArd: tickets -> new ticket. Are you logged in?
04:09AWizzArdI am logged in, and I am a watcher.
04:10AWizzArdBut I don't have the "new ticket" button
04:11liwpAWizzArd: I think you have to be a member to add a new ticket
04:11liwpAWizzArd: rich needs to add you as one
04:11liwpI can open one for you if you like
04:11AWizzArdOkay, I see.
04:11AWizzArdstuartsierra asked me to open two tickets, but so far I couldn't do it
04:12AWizzArdliwp: one is about a potential bug in clojure.contrib.profile.
04:12AWizzArdWhen you have (defn foo [x] (prof :foo (+ x 10))) and then do (profile (map foo (range 5))) ==> java.lang.IllegalArgumentException: Wrong number of args passed to: core$max
04:13AWizzArdbut profiling a doseq works fine
04:13liwpok...
04:13liwpI've never used profile myself
04:14AWizzArdAnother problem is in clojure.contrib.duck-streams, with append-spit. I start appending with the *default-encoding* bound to "UnicodeLittle" (can be something else also). This format has a marker at the beginning of the file.
04:14AWizzArdThe problem is: when I append-spit to that file again, then again this marker is written
04:14AWizzArdappend-spit must only write it once, when the file is created for the first time.
04:15liwpok
04:15AWizzArdthose are the two
04:15liwpcan you write up the issue and provide a test case of some kind, PM them to me and I'll open the tickets
04:15AWizzArdyes
04:16liwpand include your name so I can attribute the issues to you
05:47tomojhow do you test macros?
05:49mccraig,(doc macroexpand-1)
05:49clojurebot"([form]); If form represents a macro form, returns its expansion, else returns form."
05:49tomojI guess one level is enough for testing
05:49tomojyeah, otherwise it would get crazy
05:50mccraig(,doc macroexpand)
05:51mccraigoops
05:51mccraig,(doc macroexpand)
05:51clojurebot"([form]); Repeatedly calls macroexpand-1 on form until it no longer represents a macro form, then returns it. Note neither macroexpand-1 nor macroexpand expand macros in subforms."
05:51liwpmccraig: is there any way to expand e.g. cond which has a cond subform in it?
05:51tomojliwp: c.c.macro-utils
05:52tomojmexpand-all
05:52liwptomoj: and that _will_ expand subforms?
05:52tomojyep
05:53tomoj,(require 'clojure.contrib.macro-utils)
05:54clojurebotnil
05:54tomoj,(clojure.contrib.macro-utils/mexpand-all '(cond t 3 :else 4))
05:54clojurebot(if t 3 (if :else 4 nil))
05:54liwpahh, seems like slime-macroexpand-all does exactly what I want after all. I don't know how I missed that earlier
05:54tomojdoes slime-macroexpand-all use mexpand-all, I wonder?
05:55tomoj,(macroexpand '(cond t 3 :else 4))
05:55clojurebot(if t 3 (clojure.core/cond :else 4))
05:55tomojmaybe it does the recursion itself
05:56liwpI think I must have tried macroexpand-1 and macroexpand and then decided that one cannot expand the subforms
05:56liwptomoj: I think it'll call macroexpand repeatedly unitl the form does not change
05:56liwpor something
05:56tomojthat won't help
05:57tomojthat's pretty much what macroexpand does itself
05:57tomoj,(macroexpand '(if t 3 (clojure.core/cond :else 4)))
05:57clojurebot(if t 3 (clojure.core/cond :else 4))
05:58liwptrue
05:59liwpthere doesn't seem to be anything related to macroexpansion in swank-clojure...
06:00tomojI think the one from regular old swank works just fine
06:00tomojsince we have macroexpand and macroexpand-1
06:01liwpi'm just confused how it expands the subforms then
06:01tomojI don't really know how swank works
06:02liwphmm
06:03tomojslime-macroexpand-all doesn't work for me
06:03tomojit expands (cond 1 3 2 7) to (if 1 3 (cond 2 7))
06:04liwpI get: (if 1 2 (if 3 4 nil))
06:04tomojweird
06:04tomojmaybe different swank-clojure versions..?
06:04liwppossibly
06:04tomojor different slime setups, or I dunno what the hell else
06:04tomojslime/swank is a mystery to me
06:05liwpto most people I would expect ;)
06:06tomojI see something in swank-clojure
06:06tomojbut it says "not implemented yet, needs walker" for me
06:06liwpI think my swank-clojure is from a checkout made on april 17th
06:06liwpwhich function is that?
06:07tomojin swank/commands/basic.clj, there's a (defslimefn swank-macroexpand-all ...)
06:07liwpahh, I just searched the *.el files!
06:08tomojand some code in swank/clj_contrib/macroexpand.clj
06:08liwpI have the same comment in basic.clj
06:09liwpThe body is (apply-macro-expander macroexpand-all string)
06:10liwpit seems to rely on some code from contrib. Is that code included in swank-clojure or does it expect you to have contrib in your swank classpath?
06:11liwpAFAICT macroexpand.clj tries to load clojure/contrib/walk.clj and if that succeeds it sets walk-enabled? to true
06:12liwpso do you have contrib in your classpath? That might expains why it's not working for you
06:14tomojI have contrib, but no walk.clj
06:15tomojah, walk.clj has moved into core
06:16tomojso I have it, but swank-clojure thinks I don't because it's looking in the wrong place
06:16liwpI probably then have a somewhat old clojure / contrib checkout
06:16clojurebotclojure is cheating
06:16tomojjust like clojure-test-mode doesn't work because it still uses clojure.contrib.test-is
06:16tomoj(which is now clojure.test)
06:16liwptry updating swank-clojure
06:16liwpor maybe you tried that already
06:16tomojyeah, when I last checked they hadn't fixed it
06:16tomojbut that one was an easy fix
06:17tomojthis one looks to be too, just gotta change the path
06:17liwpyep
07:13AWizzArdcgrand: do you remember the bug I found on August 27? StringSeq is counted but doesn't implement count().
07:15rhickeyAWizzArd: fixed - http://www.assembla.com/spaces/clojure/tickets/186
07:16AWizzArdrhickey: good, thanks
07:16rhickeythanks cgrand
07:16rhickeyand chouser
07:16AWizzArdThank you, you two *handshaking*
07:18AWizzArdrhickey: btw, as a watcher one can't open new tickets on assembla right? stuartsierra asked me to open two of them, but I can't do it. (liwp offered to submit them for me, and I already forwarded a mail to him)
07:18rhickeyAWizzArd: sure you can, use the Support tab
07:19AWizzArdI see several links and buttons there, but they don't look like "Open new ticket". Maybe I am just blind...
07:23rhickeyAWizzArd: you are a watcher?
07:26rhickeyAWizzArd: ah, I see contrib was not set up same as core, try now, you should see big New Ticket button
07:31AWizzArdrhickey: yes, now there is this button
07:31AWizzArdthanks
07:33liwpAWizzArd: I got your email but I haven't submitted the defect yet. Do you want to do it yourself, if that's possible now?
07:48AWizzArdIt's possible. Okay, then I submit it myself. Thanks liwp.
07:52liwpAWizzArd: ok.
08:16fsodomkahello!
08:17fsodomkaI have been wondering about handling nil value...
08:17lisppaste8fsodomka pasted "Handling nil value" at http://paste.lisp.org/display/86860
08:18fsodomkais there any improvement possible in these cases?
08:18fsodomkasomething like adding error messages etc. ?
08:20ChousukeI think checking for nils would incur a performance penalty
08:20fsodomkayes, that's what I thought...
08:20Chousukethe JVM doesn't do it, so I don't think Clojure should :)
08:22Fossido you think it's possible to check the types of things as kind of a post-compile task?
08:23Chousukewell, Clojure being dynamic there's not much it can do.
08:23Chousukethough, the Compiler at the moment does not even try :)
08:24Fossii mean if you make take type hints serious, it should be possible to infer them as far as possible
08:24Fossiand warn when they aren't any
08:24fsodomkaso it looks that we can check only for direct nil - and that case isn't all that interesting :-)
08:24ChousukeI suppose no-one is interested in hacking the Java compiler.
08:25Chousukeit needs to be rewritten in Clojure first
08:26Fossican't you do the checking while you walk the source anyway?
08:26hiredman~deft
08:26clojurebotdeft is http://gist.github.com/128259
08:27ChousukeI don't think the type hints should be considered anything more than what they are: a way to avoid reflection.
08:28Fossiwell, left aside the debate about usefulness of static typing i'd like to be able to shut up people who bitch about how scala and haskell are so much superiour because of their static typing
08:29ChousukeAnd then you can just walk away and write some working code while they fight with the compiler
08:29Fossi:D
08:30Fossithe deft looks like a good example of how it might work and also how painful it would be, thanks :)
08:37fsodomkaok, thanks for discussion!
08:40AWizzArdFossi: it is possible to statically check Clojure code in principle.
08:40Chousukeexcept if you allow runtime modification. :/
08:40AWizzArdtrue
08:41Fossithat's what i expected, just that nobody who has ever used lisp cares about it a lot ;)
08:41AWizzArdIf you want a statically checked program then your program may not be modified at runtime.
08:41ChousukeI think Common Lisp compilers do quite a lot of static type checking
08:41Fossiwell, you can't type check dynamic modifications to java code either
08:43AWizzArdChousuke: sbcl can do some, but it is very far from doing what is possible.
08:44Fossibut i guess type infering could still be better than the deft things
08:44ChousukeBut if Clojure gets static type checking at some point I imagine it would have to be done so that you can't actually *require* that the types match. That would lead to the kind of inflexible type hierarchies that Clojure tries to avoid
08:44Fossiwould result in a more scala way of typing as opposed to having to add the type all over the place
08:44hiredmandefintely
08:45Fossicould still be an option
08:45Fossii mean if people must...
08:45hiredmandeft was just me exploring, and I don't know anything about type systems
08:45Fossineither do i ;)
08:46AWizzArdChousuke: only optional static typing
08:46Chouserthe thing is, if a type system isn't completely optional, it's just a matter of time before it forces you to solve your problem in a less natural (and therefore harder to understand, maintain, etc.) way.
08:47AWizzArdYes, it should be fully optional.
08:47AWizzArdI want to remind interested people of http://groups.google.com/group/clojure/browse_frm/thread/7a48f48e4b197a15
08:48liwpErlang has some sort of type checker thingy (the name escapes me now - analyzer?) that looks at type annotations and warns you of possible type errors
08:48AWizzArdliwp: the Erlang Dyalizer
08:48AWizzArdIt is also mentioned in the GG post.
08:48liwpit's a static analyser that's run against the source independently of compilation
08:48Chouserand in an attempt to avoid that without actually making the type system option, you end up with more and more complex type systems that take more and more time to create, understand, and use.
08:48liwpAWizzArd: yeah, that's it
08:48Fossiyeah. i toyed around with it a year or such ago
08:48Fossiworks pretty well
08:49AWizzArdChouser: yes, it can become complex.
08:49Fossistill, some people like that
08:49AWizzArdIt can help to eliminate many bugs.
08:50AWizzArdIf it is completely optional, then nothing needs to be changed in any Clojure program.
08:50AWizzArdBut when Clojures core and Contrib get completely type hinted, then lots of information will be already there.
08:51AWizzArdOne way may be: implement this functionality in FindBugs.
08:51AWizzArdIt already can do very good analyses, and it could be extended to also use Clojures meta data.
08:52ChouserI've not used a language with a fully optional static type system -- dunno how that work or feel. Maybe I should learn Erlang.
08:52AWizzArdChouser: you can code as you do it now. Your editor would be connected with the type engine and get feedback.
08:53AWizzArdFor example, you write (def x 10). Then your editor can ask the type engine for the type of x. It will suggest int. Then your editor can either add the meta data for you (and show/hide it via code folding, depending on your preferences).
08:53AWizzArdOr the editor could offer a button: static analyses, and then show you all cases.
08:53Chouserick
08:54AWizzArdChouser: try FindBugs.
08:54AWizzArdI used it already to find several unused vars in Clojure :)
08:54AWizzArdEnclojure could be connected to FindBugs via a plugin. Same with emacs or vimclojure, etc.
08:54rhickeyI want runtime types like GoodCustomer, LateTrain etc - that's where the semantics of the program lie
08:55liwp~google FindBugs
08:55clojurebotFirst, out of 139000 results is:
08:55clojurebotFindBugs™ - Find Bugs in Java Programs
08:55clojurebothttp://findbugs.sourceforge.net/
08:55AWizzArdrhickey: a declerative mechanism would be needed to declare some types.
08:56AWizzArdFor example, a good customer could be a StructMap that has the two keys :name and :money, and where name is a string and money an integer greater than 1000
08:56AWizzArdSo, a declerative mechanism that allows the developer to describe what is in her collections.
08:57rhickeyAWizzArd: I'd want full runtime predicate logic
08:57rhickeyoverlapping taxonomies
08:57rhickeyimplication
08:57AWizzArdmaybe by connecting the meta data with Drools?
08:58AWizzArdI made already some progress, i hope in the coming weeks my lib will be ready.
08:58rhickeyrule engines are much closer to what people really need than are typical static type systems
08:59AWizzArdThey are indeed very helpful. And as I said, I made some progress. I just don't have so much freetime at the moment, but soon I hope I can publish the lib.
08:59AWizzArdThen we can use (defrule ...) and friends in our Clojure code.
09:06LauJensenAWizzArd: Got your code Gitted some where?
09:07AWizzArdNot yet, but soon it will be available. (via hg *g*)
09:08LauJensenk, then nevermind :)
09:08AWizzArdheh
09:13FossiAWizzArd: why drools and not a port of something lispy?
09:13AWizzArdDrools is the engine which will do the rule checking. The language how we Clojure users interact with it is: Clojure.
09:14AWizzArdCan't get more lispy than that :)
09:14AWizzArdFossi: but you can feel free to add support for Jess for example. It just is not so usable for most people, because they don't have the tens of thousands of dollars with which they could buy a license.
09:15AWizzArdAnd also Drools seems to be better than most alternatives and can even compete performance-wise with commercial solutions.
09:15Fossijust wondering :)
09:15Fossididn't even know it
09:16AWizzArdstuartsierra: Today rhickey changed the options in assembla so that I could open the two new tickets for Clojure Contrib, as you requested.
09:16stuartsierrathanks
09:16AWizzArdFossi: for us it will look completely like a Clojure program.
12:08AWizzArdcemerick: 148 people in here now... soon we'll be back at the state we had in January.
12:08manic12how does one ask clojure repl what the java classpath is
12:08AWizzArd(System/getProperty "java.class.path")
12:09Chouserevery classloader has its own classpath, however.
12:09cemerickAWizzArd: yeah, I suppose. Of course, you know I'm pretty unconcerned about numbers above "critical mass".
12:09cemerick(which I think clojure has been above for some time
12:10technomancyspeaking of classloaders, is there anything about the one returned by (.getContextClassLoader (Thread/currentThread)) that would prevent it from working with the Maven Embedder via plexus?
12:10AWizzArdBtw, is it possible to let Java GC some classes, and/or unload things?
12:11manic12ok, thanks, I found my jar file on the classpath
12:11manic12how do I access the classes in that jar file?
12:11liwpAWizzArd: I think that can only happen if the class loader that loaded the class is discarded
12:12liwpAWizzArd: I'm not sure how the mechanics of it work
12:13liwpmanic12: huh? You mean how do instantiate one of the classes or how you access the byte code? or something else?
12:13AWizzArdI just have the requirements to generate a parser while my program is running. fnparse sounds like a good way, but will be very slow.
12:13manic12I would like to instantiate one of the classes
12:14liwpAWizzArd: so you'd like the parser to be unloaded after you don't need it any more?
12:14AWizzArdOne other idea is that my program could output an input file for JavaCC. Then my program calls javac and compiles JavaCCs output, and loads it and can then use it.
12:14liwpmanic12: (foo.bar.Baz. <args>)
12:14AWizzArdliwp: yes, like that.
12:14liwpif the jar is in your classpath, then you can just call new on it
12:14liwpwhich is what the above clojure code does
12:15liwpAWizzArd: I would say that it's not worth the effort
12:15manic12where foo.bar.baz is the package specified in the java file which created the class that went into the jar?
12:15liwpmanic12: yep
12:15Chousermanic12: yes, and it must also match the path to the .class file within the jar
12:16Chousermanic12: so the jar should contain a file foo/bar/Baz.class
12:16Chousermanic12: that class should have been generated by a .jara file that starts with "package foo.bar" and has "class Baz { ..."
12:16Chouser.java file
12:17liwpAWizzArd: IIRC in clojure each function gets loaded in with its own class loader so that the function can be garbage collected if it is no longer referenced by the clojure environment
12:17Chouserand the jar itself must appear on your classpath (not just the directory that contains the jar)
12:18liwpAWizzArd: there were some problems at some point with code that generated a lot closures and those were not GC'd properly and that was somehow related to classloaders
12:18manic12ok, so I'm sticking these java files in the wrong directory for their corresponding package name?
12:18stuartsierraliwp: that's mostly been fixed, I think
12:19liwpstuartsierra: yeah I think so too
12:19AWizzArdI should ask on the mailing list about ideas regarding my parser. Maybe there is a trick how to cope with dynamic grammars.
12:21liwpAWizzArd: maybe you can use a parsing framework that allows you to generate a parse at runtime and you just discard that parser once you're done with it. You'll keep the parser generator classes in memory, but the parser instantiation will be GC'd
12:22liwpI don't know if such frameoworks exist though
12:23AWizzArdliwp: the clojure lib "fnparse" can do this. That is a parser combinator.
12:23liwpAWizzArd: you said above that it would be slow, have you tried it?
12:24AWizzArdI have tried it.
12:24AWizzArdbut currently slow is better than a non-available feature :)
12:25liwphehee
12:25liwpI guess a Java parser generator would generate a class file for you, which would result in the exact problem that you were trying to avoid...
12:33AWizzArdliwp: would be no problem: I just load the class file, when it is not needed anymore i delete it, and let javacc generate another .class file for me (a newer, updated version).
12:33AWizzArdgot to go
12:56tomojAWizzArd: know of a guide for fnparse for dummies?
12:56tomojI tried reading the docs and become immensely confused
12:59liwptomoj: you might want to look at some parsec tutorials. Parsec is a parser combinator library in haskell, but I think the concepts should translate well from haskell to clojure
13:00tomojliwp: thanks, will investigate
13:02lisppaste8drewr pasted "print-dup bug?" at http://paste.lisp.org/display/86882
13:02drewram I doing something wrong there?
13:05hiredmanclojurebot: ticket #176
13:05clojurebot{:url http://tinyurl.com/m253vo, :summary "structs printed with *print-dup* true cannot be read", :status :new, :priority :normal, :created-on "2009-08-18T16:11:11+00:00"}
13:06drewrbummer
13:18LauJensen~def sort
13:27travisbradyi'm trying to follow these examples, how do I verify that I've actually connected?
13:32travisbradyoh gosh, *these* examples http://en.wikibooks.org/wiki/Clojure_Programming/Examples/JDBC_Examples
13:36LauJensentravisbrady: get this and run the demo for whatever DB you're on
13:36LauJensen~clojureql
13:36clojurebotclojureql is http://gitorious.org/clojureql
13:37hiredman:/ assembla will let you get a specific ticket (by number) without having to login, but not a list of all the tickets for a space
13:55travisbradyLauJensen: thanks, I'll check that out
13:55LauJensenk
14:00LauJensen(defn qsort [coll] (when-let [[x & xs] (seq coll)] (concat (qsort (filter #(< x %) xs)) [x] (qsort (filter #(>= x %) xs)))))
14:00LauJensenrhickey: Thats a quicksort (which I didn't write), and like so many other things it will quickly blow the stack. Is there any hope that one day the Clojure compiler will automatically handle its ressources in a way which prevents stack explosions?
14:01travisbradyhow does one simply run a .clj file? I'm currently doing "java -cp $VIM_CLOJURE_CP:vertica_3.0_jdk_5.jar clojure.lang.Repl vclj_test.clj" but it drops me in the Repl when I'm done
14:02DraggorIs there a working example of gen-class somewhere? What's currently on clojure.org comes up with errors.
14:02hiredman:|
14:02hiredmanclojure.main
14:02hiredmanDraggor: if it doesn't work you are doing something wrong
14:03technomancyLauJensen: we're waiting on the JVM handling that; clojure's compiler will not.
14:03LauJensenOk
14:03hiredmanhttp://gist.github.com/179346 is a gen-calss test script
14:06travisbradyhiredman: thank you
14:06dnolenLauJensen: for what's it that implementation of qsort will definitely blow the stack on every lisp that I know of.
14:06dnolenfor what it's worth
14:07LauJensenI know, I was just hoping for Rich to mastermind our way out of that situation
14:07travisbradyWould using an IDE ease my introduction to clojure? I'm looking to be able to easily build distributable internal (mostly database) applications
14:08hiredmanpoorly executed algorithms will always behave poorly
14:08dnolenLauJensen: haha, you should just look for an iterative implementation of qsort.
14:08LauJensendnolen: why? My desire is for nice looking elegant code to work, and not force me into a situation where I need to rewrite everything pretty to something ugly because of the stack
14:09dnolenLauJensen: except your implementation clearly shows that you want to blow the stack ;)
14:13LicenserI think from the readability point of view it is a very nice implementation of quicksort
14:13cgranddnolen: maybe a smart enough compiler could optimize it as (throw (StackOverflowException.))?
14:16LauJensendnolen: Its not that I want to blow the stack, but its a beautiful example of clear lisp code, which anybody can read and deduct that it's a quicksort. It should work!
14:18a5t3r1xis there a way to pick up the automagically fill up the doc string in with-command-line as indicated here?
14:19a5t3r1xis there a way to automagically fill up the doc string in with-command-line as indicated here?
14:19a5t3r1xhttp://pastebin.ca/1561292
14:19LauJensenfill up ?
14:19LauJensenaah I get it
14:20a5t3r1xLauJensen: sorry typos!
14:21LauJensen(def
14:21LauJensen #^{:arglists '([coll])
14:21LauJensen :tag clojure.lang.ISeq
14:21LauJensen :doc "Returns a seq of the items after the first. Calls seq on its
14:21LauJensen argument. If there are no more items, returns nil."}
14:21LauJensen next (fn next [x] (. clojure.lang.RT (next x))))
14:21LauJensenoops
14:21dnolencgrand: interesting idea, would have to be a smart compiler :) seems like it would have to preserve the stack, serialize it, store that somewhere, and continue. or something. seems like it might be difficult to make that fast as well.
14:22LauJensen~def first
14:22LauJensenCheck that out a5t3r1x
14:22travisbradyis there a Repl command ala ghci's :type?
14:23dnolentravisbrady: does that return the type of something?
14:24travisbradydnolen: yes
14:24dnolen,(type 1)
14:24clojurebotjava.lang.Integer
14:24dnolen,(type #^{type:'my-type} {:foo 'bar})
14:24clojurebotInvalid token: type:
14:25dnolenoops
14:25dnolen,(type #^{:type 'my-type} {:foo 'bar})
14:25clojurebotmy-type
14:25dnolentoo much javascript recently.
14:26travisbradydnolen: thank you
14:26dnolennp
14:26travisbradywhat's the idiomatic way to iterate over a map?
14:26a5t3r1xLauJensen: confused
14:27LauJensena5t3r1x: What confuses you young man ?
14:27cgrandtravisbrady: seq on a map returns a sequence of key-value pairs
14:29cgrand,(filter (fn [[k v]] (odd? v)) {:a 1 :b 2 :c 3})
14:29clojurebot([:a 1] [:c 3])
14:29a5t3r1xLauJensen: it doesn't still tell me how I can access the ":doc" string defined at the namespace level for the script/module
14:30LauJensena5t3r1x: The doc string in that case, is meta data, lookup meta and with-meta
14:30LauJensen,(meta #^{:doc "foo"} {:a 1})
14:30clojurebot{:doc "foo"}
14:31travisbradycgrand: ok, say for instance I had the map [:a 8 :b 9] and I just want to print to the screen one row for each kv pair in the format "Key: a, Value: 8"
14:33cgrand,(doseq [[k v] {:a 8 :b 9}] (println "Key:" (name k) "Value:" v))
14:33clojurebotKey: a Value: 8 Key: b Value: 9
14:35a5t3r1xLauJensen: to get the meta info on an object, I can use (meta <object>), but lets say I've a file called Dummy.clj and if it has meta info at the top like this - http://tinyurl.com/p7lg2g, how do I access that?
14:36Chousuke(meta (find-ns 'nsname))
14:37LauJensenWhat he said
14:39a5t3r1xChousuke: thanks
15:00jbellplease could someone run me through an effective way to find out how to do the following with any available clojure documentation? I'd like to take every other item in a list and do something with all of those items. I'm currently just looking through the huge list of core functions, but I expect there's a better way?
15:01dnolenjbell: you could partition the list and map over that taking the first or second item.
15:01clojurebotmap is *LAZY*
15:01technomancyjbell: (def t (atom false)) (map action (filter (fn [_] (swap! not t) @t) coll))
15:02dnolen, (map first (partition 2 (range 10)))
15:02clojurebot(0 2 4 6 8)
15:02technomancyyou'd want to use let instead of def for the atom actually
15:03jbellthat's a good version dnolen
15:03jbellthanks
15:03jbellI'm just working the other out
15:03technomancyyeah partition is probably better
15:04konrI'm studying Software Engineering this semester, using bread-and-butter Java and OO. I want to study how FP and Clojure can fit in this world. Can you recommend me some books/resources on the subject?
15:04jbellthere are video lectures for people coming from Java on blip.tv
15:06dnolenkonr: also you can't go wrong with Programming Clojure, http://www.pragprog.com/titles/shcloj
15:10jbelllol, I bought the strings one from a library for about 50p
15:10jbell~$1
15:10clojurebotexcusez-moi
15:11jbellvol 3 sorting and searching
15:12hiredmannice
15:13konrdnolen: Well, I'm already using clojure in a personal project and reading this book, which is great... I'm interested, however, in modeling software outside the OO view. My Software Engineering material seems to be closely tied to this paradigm, and I'm wondering if there are alternatives...
15:14jbellhiredman: how do you know where all the functions are in clojure? do you just work through learning them from the clojure website?
15:15hiredmanwent through euler stuff up to around problem #20, which was nice for kind of familarizing myself with the sequence library
15:15hiredmanI still am often surprised by the existence of a function
15:18fyuryujbell: reading core.clj is a good way to learn
15:21DraggorWhelp, got the basics of gen-class working. What I can't quite figure out is the following: I just want to have a constructor that calls a protected method from the parent class in it, and that constructor takes one string argument.
15:23jbellhiredman: in Java, I know where to look: if I don't know a library/package name I search on google -- like say regex -- and then there's either a trail to kick start or if I'm already a bit familiar I know everything's ordered into objects so I can just look at the Javadoc, which then provides examples etc. which is quite productive, because it's very task-focused...
15:26hiredmanjbell: clojure.org
15:27jbelllol, no... although I think clojure.org is great, it's not like that: there isn't cross-referencing, for example
15:27hiredman*shrug*
15:27jbellwell, linked cross-referencing on the long list of api functions
15:28dnolenjbell: it seems daunting at first. But really you only use a handful of functions. also 90% of the time if something seems like it would be useful, it exists. and lastly, there's almost always someone here who knows something.
15:29dnolenjbell: this is also useful, http://java.ociweb.com/mark/clojure/ClojureCategorized.html
15:31tmountain+1 for clojure categorized, I use it whenever I'm trying to track down a specific type of function
15:32tmountainthere's also the clojure cheat sheet, which is great - http://tinyurl.com/qcxmrw
15:32ambientwhat's a good way to refer to the project root? i need to read resource files from res/ but don't know what the default path is?
15:32DraggorAnyone avialable to help with gen-class?
15:32jbellthanks dnolen and tmountain, I'm just looking
15:35jbellyeah, I saw that cheat sheet, but there's still a big void between me seeing many of the words and then comprehending what it means
15:35DraggorThere is a distinct lack of good examples in clojure I've come to find.
15:35ChouserDraggor: you saw :exposes-methods ?
15:35DraggorChouser: I did, poked with it, none of it was successful
15:36Chouseryou need to use that to get at the protected method of the base class
15:36DraggorHmm, I think I just read something I missed before, let me try again
15:37ChouserDraggor: then you probably want a :post-init to call that exposed method.
15:38tmountainjbell: admittedly, there are cases where examples would be helpful. I believe there's been some discussion on adding examples to the API docs recently.
15:40DraggorChouser: almost there, I need to have a matching constructor
15:40ambienti can write "true" as a value in java interop?
15:40ambientlike (def af (AudioFormat. (params :sample-rate) 8 1 true true))
15:40hiredman,(= true (Boolean/valueOf "true"))
15:40clojurebottrue
15:40hiredmantrue is java's true
15:41ambientok cool :)
15:45jbellI just looked for partition in the ClojureCategorized, and it was under the heading 'sequence operations to do other things', lol
15:45DraggorChouser: Even just trying to expose the method and call it, still yells at me for not having a matching method
15:46Chouseryou're trying to call it via the new name you gave it?
15:47Chouserdo you have use contrib repl-utils? I rely heavily on the 'show' function to figure out java interop errors.
15:47DraggorChouser: http://pastebin.org/16839
15:48hiredmanChouser: I could just give him the wallhack method
15:49DraggorI don't have repl-utils yet
15:51Chouserdoesn't that gen-class usage error out? I think you want '{setName Name} or something.
15:51ChouserI don't think bare words will work there, you need quoted symbols or strings or something.
15:51hiredmanDraggor: I use something like http://paste.lisp.org/display/83651#1 to call setName on pircbot
15:51DraggorDoesn't error on me that I see
15:51hiredmanso I don't have to AOT compile at all
15:52DraggorHmm
15:52hiredmanI just proxy PircBot
15:52Draggorwill that work on a proxied pircbot instance?
15:52Draggorthere we go
15:53Chouserhiredman: why do you call it wallhack?
15:53DraggorIt's using reflection to dig in and get it, despite 'walls' to keep the user out
15:53Draggoror something like that?
15:53hiredman"Wallhacking is the changing of wall properties in first-person shooters. Most wallhacks are used to make a map's walls at least partially…"
15:54hiredmanwikipedia apparently has a whole article on it :P
15:54ambient(make-array Byte 100) is boxed bytes? how can i make non-boxed? (make-array (.type Byte) 100) doesnt seem to work
15:54hiredmanByte/TYPE
15:54ambientthanks
15:55hiredmanhttp://clojure.org/java_interop#toc31
15:55hiredman:(
15:55hiredman(. Integer TYPE)
15:55ambientyeah, out of date or something
15:56ambientoops
15:56ambientseems it starting to be too late :P
15:56ambienti read that whole thing but somehow missed the last part
16:01Draggorhiredman: thank you very much! Success!
16:02Chouserproxy needs to expose base methods and fields automatically
16:02Chouserhave I mentioned that before? :-)
17:02ambienta bit off topic but anyone used Project Kenai from Sun (source hosting service)? is it any good?
17:02LauJensenHaven't tried, but Gitorious + Lighthouse is working very well for us
17:03ambientyeah, i'm currently on bitbucket.org myself
17:04LauJensenOk
17:08hiredman~ticket search struct
17:08clojurebot("#176: structs printed with *print-dup* true cannot be read" "#50: GC Issue 46:\tcallable defstruct (PersistentStructMap$Def extends AFn)" "#174: Make c.l.Keyword Serializable" "#37: GC Issue 33:\tresultset-seq breaks when the result set contains duplicate column names (with patch)")
17:08hiredman*tada*
17:08Chousernice. those are only open ones?
17:09hiredmannope
17:09hiredmanthat is via screenscraping the assembla search page
17:09Chouserthey have documented API too
17:09hiredmanyeah
17:10Chouserwhich is great as long as you're not trying to attach a file to a ticket.
17:10hiredmanbut to get a list of tickets you need to login
17:10Chouserah, ok.
17:10hiredmanand it doesn't seem to work even when I give a login
17:11hiredman~ticket #176
17:11clojurebot{:url http://tinyurl.com/m253vo, :summary "structs printed with *print-dup* true cannot be read", :status :new, :priority :normal, :created-on "2009-08-18T16:11:11+00:00"}
17:11hiredmanthat is via the api though
17:11drewrhiredman: I wish you had put all of that effort into fixing that bug :-)
17:12hiredmanwhich bug?
17:12drewr~ticket #176
17:12clojurebot{:url http://tinyurl.com/m253vo, :summary "structs printed with *print-dup* true cannot be read", :status :new, :priority :normal, :created-on "2009-08-18T16:11:11+00:00"}
17:12hiredmanhttp://gist.github.com/184831
17:13hiredmangnarly
17:13drewrnice
17:13drewris that using tagsoup?
17:13cemerickheh, zip-soup
17:14hiredmanyeah
17:15Chousukeparen-soup, that :P
17:16hiredmanthe great thing about -> is you just reverse the order and wrap everything in comp, and suddenly you have a point free function
17:18cemerickpoint-free is getting a lot of press in these parts lately
17:28clojurehiredman: maybe that function should be called <-
17:29hiredmancomp?
17:29hiredmanshould be ·
17:29clojurerevering -> order, and adding in comp
17:33jbellcan anyone think of a good way to get every other item in a seq? (map first (partition 2 list)) doesn't work because partition doesn't create a partition of the last item in an odd-sized sequence
17:34Chouser(map second (cons nil (partition 2 list))) ?
17:34Chouserer
17:34hiredmanuh
17:34Chouser(map second (partition 2 (cons nil list))) ?
17:34hiredmanwhat about nth?
17:35hiredmaner not nth
17:35Chousertake-nth
17:35ChouserI always for get him
17:36jbell,(map second (partition 2 (cons nil list)))
17:36clojurebotjava.lang.IllegalArgumentException: Don't know how to create ISeq from:
17:36hiredman,(doc take_nth)
17:36clojurebotexcusez-moi
17:36hiredman,(doc take-nth)
17:36clojurebot"([n coll]); Returns a lazy seq of every nth item in coll."
17:37ambient,(take-nth 2 (range 10))
17:37clojurebot(0 2 4 6 8)
17:37jbell,(take-nth (range 5))
17:37jbellwhoops
17:37clojurebotjava.lang.IllegalArgumentException: Wrong number of args passed to: core$take-nth
17:38jbell,(take-nth 2 (range 5))
17:38clojurebot(0 2 4)
17:38jbellthat seems like a strange name for that function
17:39ambienti think it's pretty logical
17:41ambient(map #(foo %) (range array-len)) is a good idiom when generating arrays from a function?
17:42ambientbecause it's all lazy perhaps i don't have to even think about this
17:42clojureChouser: what's the status of clojurescript?
17:42hiredmanambient: eh?
17:42hiredmanhow does that generate an array?
17:43ambient(into-array Byte/TYPE (map
17:43ambient #(byte (* 127 (Math/sin (* % 0.2))))
17:43ambient (range (* (params :sample-rate) 2)))))
17:44ambienthmhm, but a better way perhaps would be to (take array-len fun-function)
17:45hiredman,(doc amap)
17:45clojurebot"([a idx ret expr]); Maps an expression across an array a, using an index named idx, and return value named ret, initialized to a clone of a, then setting each element of ret to the evaluation of expr, returning the new array ret."
17:46ambientthe point is that i'm not mapping over an existing array, i'm generating it
17:46ambienttype-conversion happens at (into-array Byte/TYPE...
17:47hiredmanI know, but you might find amap, areduce, etc useful if you are using arrays
17:47ambienti probably will :)
17:48Sivajagdoes anyone where I could find info on setting my carbon emac to run repl?
17:49technomancySivajag: http://technomancy.us/126
17:50ChousukeWhy would you use carbon emacs? :/
17:51Sivajagi wish I could just use textmate
17:51SivajagI am a begineer for emac :(
17:51Chousukeyou could try aquamacs or at least emacs.app
17:51ChousukeCarbon emacs is obsolete. :/
17:52rsynnottEmacs.app is possibly the best at the moment
17:52rsynnottAquamacs has horribly messed up keybindings, though I assume it can be fixed
17:52Sivajagok I am bought :)
17:52ChousukeAquamacs might be easier to get started with though. pick your poison: http://emacsformacosx.com/ or aquamacs.org
17:53rsynnott(Astonishingly, Emacs.app survived the upgrade to Snow Leopard; previously Tiger and Leopard killed it)
17:53ctdeanWhat do you get if you just build it yourself from sources on a Mac? (That's what I do)
17:53Chousukectdean: Emacs.app, I should think.
17:53Chousukeor maybe just the command line version.
17:54Chousuke(which is still there with emacs.app, just inside the app bundle)
17:54rsynnottThe X11 one is surprisingly usable
17:54ctdeanOk. I always thought I was running carbon emacs. it looks like a carbon app to me, but I'm no expert on the Mac variations
17:55Chousukewell, which version of emacs is it? if it's 23, it's probably the cocoa one, but 22 used carbon :/
17:55ctdean22.2.50.1
17:56ctdeanso there ya go :)
17:56rsynnottctdean: Emacs.app is carbon
17:56rsynnottbut there was another thing called carbon emacs
17:56ctdeanI see. very confusing!
17:56winterstreamHi everyone. I can't seem to compile a Clojure file to a Java class. I have a file nl.tudelft.nas.GraphvizPlugin that I try to compile with (compile 'nl.tudelft.nas.GraphvizPlugin), but Clojure complains that it cannot find the file GraphvizPlugin.clj. However, if I rename it, Clojure says: Could not locate nl/tudelft/nas/GraphvizPlugin__init.class or nl/tudelft/nas/GraphvizPlugin.clj on classpath. Any idea on what I'm doing wrong?
17:56rsynnottindeed; the great unix-nerd migration to macos a few years back produced many such oddities
17:57Chousukersynnott: emacs.app is Cocoa since 23.1 though. :/
17:57rsynnottoh, is it?
17:57rsynnottnice
17:57Chousukeyes.
17:57rsynnottI'm still on 22.something
17:58hiredmanwinterstream: so you have a file named GraphvizPlugin.clj is nl/tudelft/nas/?
17:58ChousukeI have no problems with 23.1 :)
17:58ctdeanwinterstream: is your *compile-path* setup?
17:58hiredmanand the directory nl is in is on the classpath?
17:58hiredman~compile
17:58clojurebotthe unit of compilation in clojure is the namespace. namespaces are compiled (not files). to compile a namspace the namespace needs to be on the classpath and so does ./classes/ (and the directory needs to exist) because clojure writes the class files to that directory. http://clojure.org/compilation
17:58winterstreamOh, wait, I have to set *compile-path*? Okay, let me check...
17:59ctdean,(doc compile)
17:59clojurebot"([lib]); Compiles the namespace named by the symbol lib into a set of classfiles. The source for the lib must be in a proper classpath-relative directory. The output files will go into the directory specified by *compile-path*, and that directory too must be in the classpath."
17:59jbellambient: (take n list) means take the first n elements (I would have expected (first n list))... take-nth, that immediately makes me think 'will produce the nth' of this sequence, while I'd expect my intention to be achieved with something like (interval-seq n seq). I think 'take' is too ambiguous
17:59hiredmanwinterstream: have you read http://clojure.org/compilation
18:00winterstreamhiredman: I have, but not thoroughly enough :)
18:00ambientjbell, i think it as take-nth, drop-nth, it takes a vector instead of values
18:01ambientdrop-nth drops that vector and returns rest (i dont know if this is an actual function)
18:02ambientperhaps i should use the right terminology s/vector/sequence/
18:05winterstreamNow I'm trying
18:05winterstream(let [*compile-path* "/home/wynand/hacking/graphviz_cytoscape"]
18:05winterstream (compile 'nl.tudelft.nas.GraphvizPlugin))
18:05winterstreamBut I'm still getting no love from Clojure
18:05hiredman:/
18:05ctdeanIs that dir in the classpath ?
18:05hiredmanso much wrong
18:05winterstreamAye, it is
18:05hiredmana. forget about *compile-path*
18:06technomancydon't you need to use binding?
18:06hiredmansshhh
18:06technomancyor even def; heck
18:06hiredmandon't confuse the man
18:06hiredmanhe can deal with *compile-path* later
18:06hiredmanwinterstream: what is your classpath set to?
18:07winterstreamA lot of things, but it includes that directory. I verified this by checking (.getURLs (java.lang.ClassLoader/getSystemClassLoader))
18:07hiredmanwinterstream: what does the ns form at the top of GraphvizPlugin.clj look like?
18:08winterstream(ns nl.tudelft.nas.GraphvizPlugin
18:08winterstream (:import [cytoscape.plugin CytoscapePlugin])
18:08winterstream (:gen-class
18:08winterstream :extends CytoscapePlugin
18:08winterstream :init init
18:08winterstream :constructors {[] []}
18:09winterstream :state state))
18:09winterstreamSorry for that big paste
18:09winterstreamI should have pastebinned it
18:09dnolena little bit behind, but does no one else find Emacs.app dog slow compared to Carbon Emacs. That's been my experience anyway.
18:10hiredmanwinterstream: and GraphvizPlugin lives in nl/tudelft/nas/ ?
18:10winterstreamYes
18:10hiredmanGraphvizPlugin.clj
18:10winterstreamYes
18:10hiredmanand the directory nl is in is on the classpath?
18:10Chousukednolen: hm. Well, I wouldn't know :/
18:10winterstreamYes
18:10Chousukednolen: I don't find it particularly slow
18:11Chousukednolen: Carbon is deprecated anyway though so Cocoa is the only way forward. Hopefully it will improve.
18:11hiredmanwinterstream: and what about ./classes/ ?
18:11hiredman:|
18:12dnolenChousuke: Carbon will be deprecated when QuickTime becomes modern. Not anytime soon.
18:12hiredmanChouser: what doesn't http://clojure.org/compilation mention ./classes/ ?
18:12Chousukednolen: carbon is already deprecated and Quicktime X was just released :P
18:12hiredmanit just shows up in the examples
18:13dnolenChousuke: only partially true. QuickTime X still has to call into old APIs.
18:13dnolenthe surface area of QuickTime is unbelievably large.
18:13Chousukednolen: yeah, but that's because they haven't implemented all of the old functionality.
18:13hiredmanwinterstream: anyway, you should make a directory called "classes" and put ./classes/ on the classpath
18:13rsynnottdnolen: well, more precisely QTKit uses Quicktime X for the stuff that it supports, Quicktime 7 otherwise
18:13Chousukeright.
18:14winterstreamhiredman; cool, I'll do that quickly...
18:14rsynnott(Ars Technica's review of Snow Leopard has the full tedious details about the War on Carbon/Quicktime)
18:14dnolenin anycase, my eyes are on Emacs.app, just want the rendering to be about twice as quick and I'm sold :)
18:14winterstreamhiredman: that did the trick indeed
18:15winterstreamThanks
18:17Chousukednolen: I noticed some slowness if there is more than one frame open showing the same buffer but I don't often do that so it's not a problem. :/
18:32powr-tocwhen is it acceptable to use eval?
18:33ctdeanYou are writing your own repl or the equiv.
18:34hiredmanctdean: weeeel even then there is clojure.main/repl
18:34hiredman,(doc clojure.main/repl)
18:34clojurebot"([& options]); Generic, reusable, read-eval-print loop. By default, reads from *in*, writes to *out*, and prints exception summaries to *err*. If you use the default :read hook, *in* must either be an instance of LineNumberingPushbackReader or duplicate its behavior of both supporting .unread and collapsing CR, LF, and CRLF into a single \\newline. Options are sequential keyword-value pairs. Available options and their d
18:34tomojI was thinking I might provide a spot in a swing gui for people to edit clojure code
18:34tomojI think that would be one place
18:35tomojfor those that don't want to use their own editors I mean
18:35hiredmannah, use clojure.main/repl
18:36powr-tocI'm implementing a DSL and I want to have two interpretations of the same domain code... one that executes it literally, and the other which generates a graphical representation of the code... I was thinking I could eval the DSL in different environments, where the DSL macro's/functions had different interpretations... is that mad?
18:36powr-tocis there another, easier more sane way to do this kinda thing
18:36powr-toc?
18:37hiredman:(
18:38hiredmanyoud can use binding, or just read the code and then feed the datastructure to your display logic
18:39powr-tochiredman: Yes I was considering that option too... which would be easiest?
18:40hiredmanfeeding the datastructure into your display logic
18:40powr-tochiredman: cool... out of interest would macros work with eval under different bindings?
18:41hiredmanyes
18:42powr-tochiredman: sweet
18:48powr-tochiredman: so if I just read the stream containing my domain code in my display logic, what functions are there to convert it into a parsed s-expression/
18:48powr-toc?
18:48powr-tocor would I need to quote it?
18:49hiredmanread
18:49hiredman,(doc read)
18:49clojurebot"([] [stream] [stream eof-error? eof-value] [stream eof-error? eof-value recursive?]); Reads the next object from stream, which must be an instance of java.io.PushbackReader or some derivee. stream defaults to the current value of *in* ."
18:50powr-tochiredman: awesome!!
18:51powr-toc,(first (read-string "(+ 10 20 (* 30 30))"))
18:51clojurebot+
18:52powr-tochmmm... can you use zippers on s-expressions?
18:53hiredmansure
18:58travisbradyanyone know of a really simple page for clojure/java newbies that describes compilation and packaging? i'm looking to write a command line application with clojure
19:00hiredman~compile
19:00clojurebotthe unit of compilation in clojure is the namespace. namespaces are compiled (not files). to compile a namspace the namespace needs to be on the classpath and so does ./classes/ (and the directory needs to exist) because clojure writes the class files to that directory. http://clojure.org/compilation
19:02hiredmanhttp://github.com/nakkaya/clojure-stub/tree/master might be useful as well
19:02hiredmanclojurebot: clojure-stub?
19:02clojurebotclojure is cheating
19:02hiredmanclojurebot: clojure-stub is http://github.com/nakkaya/clojure-stub/tree/master
19:02clojurebot'Sea, mhuise.
19:02hiredmanclojurebot: clojure-stub?
19:02clojurebotclojure-stub is http://github.com/nakkaya/clojure-stub/tree/master
19:03powr-tocHas anyone implemented clojure repl in clojure yet?
19:03hiredman~def clojure.main/repl
19:04powr-tocwicked... I was looking through the clj source but couldn't see it...
19:05powr-tocbut Repl.java seemed to delegate to a clojure one
19:14travisbradyhiredman: ok, clojure-stub looks really cool, I did ant setup and ant compile but now I'm not sure how to run this jar I've created
19:15hiredmanjava -jar jarfile.jar
19:16hiredmanor java -cp jarfile.jar class.Name
19:16hiredmanwell
19:16travisbradyyes!
19:16hiredmanyou will need to have clojure on the classpath somewhere, but clojure-strub might take care of that
19:16travisbradyjava -jar hello.jar works
19:20travisbradyok so building with ant is definitely the way to go
19:35travisbradyI'm hitting an odd error, I do 'ant compile' and I can actually see that my code does a println which I can see in the ant output, but then i get this error http://gist.github.com/184921 "Exception in thread "main" java.lang.Exception: namespace 'vertoid' not found after loading '/vertoid'" what does this mean?
19:41travisbradyif i add an ns declaration it fails with "Exception in thread "main" java.lang.ClassCastException: clojure.lang.Cons (vertoid.clj:2)"
19:44hiredman~compile
19:44clojurebotthe unit of compilation in clojure is the namespace. namespaces are compiled (not files). to compile a namspace the namespace needs to be on the classpath and so does ./classes/ (and the directory needs to exist) because clojure writes the class files to that directory. http://clojure.org/compilation
19:44hiredman~namespaces
19:44clojurebotnamespaces are (more or less, Chouser) java packages. they look like foo.bar; and corresponde to a directory foo/ containg a file bar.clj in your classpath. the namespace declaration in bar.clj would like like (ns foo.bar). Do not try to use single segment namespaces. a single segment namespace is a namespace without a period in it
19:45winterstreamI'm getting a NoClassDefFoundError when trying to load my Clojure generated plugin in Cytoscape. Now, clojure.jar is in my path and the plugin loads fine when I import it from Clojure. Any idea on what could be going wrong?
19:48hiredmanlisppaste8: url?
19:48lisppaste8To use the lisppaste bot, visit http://paste.lisp.org/new/clojure and enter your paste.
21:39strlenhello. how is the programming clojure by by stuart halloway?
21:39strlendeciding to divde deeper into clojure :-)
21:53tomojstrlen: I quite liked it
21:54tomojit was my intro to clojure
22:09manic12one thing that I like about allegrocl that I would like to find an equivalent in clojure, is that any c++ object which is represented in memory as a contiguous array of floats or doubles I can pass in a lisp array of floats or doubles to the ff call
22:11manic12i'm wondering if java does the same thing, and how that looks from clojure code
22:28hiredmanno
22:34manic12shoot
22:35manic12so there is no way in java to lock the heap during a native call?
22:37hiredmanyou know, I cannot say for sure, but I would be extremely surprised if there was
22:37manic12allegro has that option
22:37hiredmanclojurebot: this?
22:37clojurebotthis is not a bug
22:38hiredmanclojurebot: this is also not allegro
22:38clojurebotIk begrijp
22:38manic12you can say :release-heap :never for a ff call
22:38hiredmanclojurebot: this?
22:38clojurebotthis is not allegro
22:41manic12I'm a bit sad because I had all this working under allegro, then rhickey came along and said cl is sub-optimal
22:42JAS415cl is sub optimal?
22:42JAS415hmmm
22:43manic12that's my impression of rhickey's talks
22:43hiredmanin computer programming, a supple mind is of great importance
22:43JAS415well CL doesn't play well with others certainly, and doesn't solve the problems clojure is supposed to solve
22:44JAS415although actually my impression of commercial CLs is that it does interoperate pretty well
22:44manic12allegrocl integrates well with C
22:44JAS415right
22:44JAS415java/.net though i guess
22:45JAS415well, I like both, for what its worth
22:45JAS415they bring different stuff to the table
22:47rhickeyI never said CL was sub-optimal
22:48manic12it's an impression
22:49JAS415then again saying something is sub optimal in the land of computer languages is kind of like saying water is wet
22:49manic12true
22:49manic12rhickey, you got a min or two to jump into this conversation about foreign code?
22:51manic12I have to make some tough decisions
22:53rhickeyhttp://java.sun.com/javase/6/docs/technotes/guides/jni/spec/jniTOC.html
22:54samhughes21:45 < JAS415> although actually my impression of commercial CLs is that it does
22:55JAS415i know, i contradict myself!
22:57manic12is that a no?
22:59rhickeyhttp://java.sun.com/javase/6/docs/technotes/guides/jni/spec/design.html#wp1265
23:00rhickeyI recommend reading the JNI docs for answers to JNI questions. It's outside the scope of Clojure, whose FFI is to Java itself, not C
23:01manic12I will, thx for the links, especially the second one
23:01rhickeymy last JNI stuff was jFli, enabling CL to talk to Java :)
23:01samhughessorry JAS415, I didn't mean to copy and paste your message onto the screen (I did, right?). My terminal froze up and that was the result.
23:02manic12but it would be nice to be able to treat C double arrays and float arrays similar to sequences in clojure
23:02JAS415ah
23:02JAS415no worries
23:04manic12I'm asking too much...need to find the happy medium
23:10manic12this is interesting...about pinning...it's not the same as a statically declared array in CL