2010-01-31
| 00:08 | pdk | you could fuse them and be a hireddawg |
| 00:09 | abrooks | dawgedman |
| 00:09 | hiredman | :P |
| 00:09 | hiredman | I bring it up because I jost noticed kdawg_ |
| 01:44 | technomancy | only one feature left before Leiningen 1.1.0 |
| 01:44 | technomancy | wute |
| 03:56 | noidi | how can I create a double[][] in Clojure? |
| 04:00 | _ato | ,(make-array Double/TYPE 10 10) |
| 04:00 | clojurebot | #<double[][] [[D@df090d> |
| 04:00 | noidi | thanks! |
| 04:48 | fholm | dmiller2718: you the guy who's working on clojure-clr ? |
| 05:15 | dr_df0 | hi everyone |
| 05:19 | dr_df0 | is anybody here? |
| 05:19 | dr_df0 | are annotations supported now in clojure 1.1.0 |
| 05:19 | dr_df0 | I would like to use jboss netty library, but it requires annotations |
| 05:25 | _ato | no, they're not supported |
| 05:27 | dr_df0 | do you know any other high performance socket server library for clojure? |
| 05:27 | dr_df0 | socket-server from contrib is not suitable |
| 05:27 | dr_df0 | since it creates thread for every connection |
| 05:28 | _ato | I'd just use NIO directly |
| 05:29 | _ato | I haven't heard of a clojure wrapper for it |
| 05:29 | _ato | there's a bunch of java NIO "frameworks" listed here: http://technfun.wordpress.com/2008/04/21/critique-of-java-nio-frameworks/ |
| 05:30 | _ato | but they sound like overkill ;-) |
| 05:30 | dr_df0 | +ato: thx |
| 05:59 | AWizzArd | Moin sys |
| 08:02 | noidi | is there something like assoc-in for conj? |
| 08:02 | noidi | I need to do this: {:foo [1 2 3]} --> {:foo [1 2 3 4]} |
| 08:03 | noidi | right now I'm tempted to make the value of :foo a ref just to make updating easier, but I know there must be a better way :) |
| 08:04 | Chousuke | noidi: updatein |
| 08:05 | Chousuke | with a dash :P |
| 08:05 | Chousuke | (doc update-in) |
| 08:05 | clojurebot | "([m [k & ks] f & args]); 'Updates' a value in a nested associative structure, where ks is a sequence of keys and f is a function that will take the old value and any supplied args and return the new value, and returns a new nested structure. If any levels do not exist, hash-maps will be created." |
| 08:06 | noidi | thanks! |
| 08:06 | noidi | that's exactly what I was looking for |
| 09:02 | AWizzArd | rhickey: is there a better/more performant way to do (= ::MyDefType (type obj))? |
| 09:03 | rhickey | AWizzArd: not really - why are you doing that? |
| 09:05 | AWizzArd | It is for my Clojure DB system. It can automatically create indexes during insertion, and for deftyped things it groups them by their type. |
| 09:05 | rhickey | ok, but why would it reference a type tag explicitly like that? |
| 09:07 | AWizzArd | Cause this can be the criteria for being taken into an index. The user can specify the criteria when to index something. |
| 09:07 | AWizzArd | And all objects one inserts that pass this test go into a specific index. |
| 09:08 | AWizzArd | (insert *db* obj) <-- this adds obj to all indexes for which obj pasess the index-predicate |
| 09:09 | AWizzArd | I just wanted to make sure that using = and type is the right thing. |
| 09:09 | rhickey | it will work |
| 09:09 | AWizzArd | good |
| 09:09 | AWizzArd | thanks |
| 10:20 | the-kenny | somnium: Does congomongo support mongo's modifiers? ($push $inc etc) |
| 10:28 | rrc7cz | has anyone implemented platform/plugin capabilities before? |
| 11:22 | satous | (doc assoc-in) |
| 11:22 | clojurebot | "([m [k & ks] v]); Associates a value in a nested associative structure, where ks is a sequence of keys and v is the new value and returns a new nested structure. If any levels do not exist, hash-maps will be created." |
| 11:22 | satous | (source assoc-in) |
| 11:26 | avarus | hi |
| 13:54 | AWizzArd | when I have a (deftype Foo [a b c]) and then (def x (Foo 10 20 30)), what name does have bar then? (bar x) ==> (:a :b :c)? |
| 13:56 | rhickey | AWizzArd: if you want map stuff, specify IPersistentMap and then you'll get support for (keys x) |
| 13:56 | rhickey | otherwise you have normal Java reflection of fields |
| 13:56 | AWizzArd | Ah sure, easy enough. I could have answered this myself. Thanks. |
| 14:10 | AWizzArd | Though it could be nice if Clojure offered its own reflection tools. Maybe this will be easier with clj-in-clj. |
| 14:19 | avarus | what's a simple template library for clojure in your opinion? |
| 14:20 | AWizzArd | avarus: template as in "html"? |
| 14:20 | avarus | yep |
| 14:20 | AWizzArd | did you look at Compojure? |
| 14:21 | avarus | oh, yes, I am just looking at it :) |
| 14:21 | AWizzArd | good choice |
| 14:21 | avarus | ok :) |
| 14:22 | avarus | I just set it up and it was very easy but I just tried the hello world for now :) |
| 14:22 | AWizzArd | This route makes sense. |
| 14:29 | avarus | the documentation is limited I think |
| 14:29 | AWizzArd | It is not optimal yet. The best thing is to start with the hello world and try to extend it a bit. |
| 14:30 | AWizzArd | Then the Google Group has code examples. There is a Wikibook with more examples. |
| 14:31 | AWizzArd | And a bit documentation you can find here: http://compojure.org/ |
| 14:31 | avarus | ya, I'm there :) |
| 14:32 | avarus | the group seems to be full of info :) |
| 14:32 | avarus | the google group |
| 14:32 | AWizzArd | Compojure learning goes likes this: read the examples, modify them, play around with them, get an impression what you want to do, try to do it, begin asking questions in the GG. |
| 14:32 | avarus | :) |
| 14:33 | AWizzArd | after a few iterations Compojure will make very much sense. It is indeed pretty simple. |
| 14:33 | avarus | fine |
| 14:37 | avarus | cool, contrib has something for json :) |
| 14:38 | qbg | When I'm use `lein repl`, I can require my project, but when I using `lein swank`, I can't. What am I doing wrong? |
| 14:41 | AWizzArd | hi cg |
| 15:08 | robwolfe | qbg: "M-x swank-clojure-project" is probably what you need |
| 15:09 | qbg | I tried that and that also didn't work |
| 15:09 | robwolfe | do you have ":dev-dependencies [[leiningen/lein-swank "1.1.0"]])" in your project.clj? |
| 15:09 | qbg | Yes |
| 15:11 | Raynes | robwolfe: You don't need lein-swank in order to use swank-clojure-project. |
| 15:12 | robwolfe | Raynes: from swank-clojure.el "Note that you must have swank-clojure.jar in the lib/ directory" |
| 15:12 | Raynes | swank-clojure.jar isn't lein-swank. |
| 15:13 | robwolfe | Raynes: right, but I thought that lein-swank depends on it |
| 15:14 | dnolen | qbg: you probably need to compile lein-swank yourself. that's what I had to do to get it to work |
| 15:14 | dnolen | I believe that lein-swank in it's current release doesn't properly add the src to the classpath |
| 15:14 | dnolen | in the lein-swank directory |
| 15:14 | dnolen | lein uberjar |
| 15:15 | dnolen | then replace the lein-swank jar in the lib folder of your leiningen repo (I 90% sure you need to be using lein from source for any of this to work) |
| 15:22 | qbg | I built it and replaced the old one. Now it doesn't complain about the ^ reader macro, but I still can't require my project |
| 15:24 | robwolfe | qbg: slime starts ok, but you can not require your project? |
| 15:24 | qbg | Yes |
| 15:25 | qbg | It is just a classpath problem |
| 15:25 | robwolfe | what's the namespace of yoour project and how do you try to load it? |
| 15:25 | qbg | Currently it is called paradigmm (yes, a dumb name) |
| 15:26 | qbg | I currently call (require 'paradigmm) from the REPL to load it |
| 15:26 | qbg | This works just fine using lein repl |
| 15:26 | robwolfe | under "src" directory "paradigm.clj" with "(ns paradigm)"? |
| 15:26 | qbg | (add-classpath also works for loading it, but is non-ideal for other reasons) |
| 15:26 | qbg | Yes |
| 15:27 | qbg | The project directory was created with lein new |
| 15:27 | robwolfe | in "lib" do you see lein-swank-1.1.0.jar ? |
| 15:29 | qbg | yes |
| 15:29 | robwolfe | hmm... it works for me just fine |
| 15:30 | hiredman | don't use single segment namespaces |
| 15:30 | hiredman | foo.bar |
| 15:31 | qbg | Yeah, I need to come up with a better namespace name anyways |
| 15:32 | qbg | Most of the code is under paradigmm.<something> currently though |
| 15:32 | qbg | Hmm... If I remove lein-swank from leiningen's lib directory and the project's directory, and then run lein deps in the project directory, lein swank doesn't work, even though the lein-swank jar is copied to the project's lib directory |
| 15:34 | robwolfe | qbg: what error do you see? |
| 15:34 | qbg | "swank is not a task. Use "help" to list all tasks." |
| 15:35 | robwolfe | so you don't have lein-swank in project.clj dev-depdencies |
| 15:35 | qbg | But in my project.clj: ":dev-dependencies [[leiningen/lein-swank "1.1.0"]]" |
| 15:36 | robwolfe | try "DEBUG=1 lein swank" and see if there is "lein-swank.jar" |
| 15:38 | qbg | There is no lein-swank in the output, nor my project. |
| 15:38 | robwolfe | qbg: I hope you don't run "lein" script from Leinigen sources? |
| 15:39 | robwolfe | I mean I hope you copied this script to your "~/bin" for example |
| 15:40 | qbg | Grr... |
| 15:40 | qbg | Running lein-stable works; I have the lein script from the leiningen checkout symlinked to my ~/bin directory |
| 15:40 | robwolfe | wrong! :) |
| 15:43 | qbg | Hmm, the readme for leiningen says under Hacking: "When that finishes, symlink bin/lein from your checkout to your path. This will make "lein" run from your checkout while "lein-stable" uses the jar self-installed in ~/.m2." |
| 15:43 | qbg | This seems misleading then... |
| 15:44 | robwolfe | it's for hacking on Leiningen |
| 15:45 | robwolfe | for other projects just use lein-stable |
| 15:47 | qbg | The Emacs Integration page on github seems to implies that you need to be hacking on leiningen to use it |
| 15:49 | robwolfe | you just need "lein" script and "leiningen-standalone.jar" and that's it |
| 15:49 | robwolfe | and "clojure" of course ;) |
| 15:50 | qbg | The documentation seems misleading then |
| 15:50 | qbg | But now it works, so I'm happy |
| 15:50 | qbg | Now to subject myself to the pain of Swing... |
| 15:55 | avarus | good night |
| 16:04 | {aaron} | hi, i had a question about clojure...what, if anything, does clojure do about non-pure functions? do these matter, or affect assumptions clojure makes? e.g. if i want to, say, list files in a directory...that is a non-pure function... do i need to tell clojure that somehow? |
| 16:04 | thearthur | I'm trying to start a vpn(n2n) process through java.Runtime.exec and when the process starts in java the ioctl fails with "device or resource busy" when it starts form the shell it works?? |
| 16:05 | hiredman | {aaron}: nope |
| 16:05 | thearthur | how does a process start by runtime.exec differ from a normal process |
| 16:05 | {aaron} | hiredman: so clojure doesn't cache results of functions, etc.? |
| 16:06 | hiredman | {aaron}: unless you use memoize |
| 16:06 | {aaron} | how about requirements for no side-effects in transactions? |
| 16:06 | hiredman | {aaron}: that is a practical requirement |
| 16:06 | {aaron} | that's my responsibility to ensure right? |
| 16:06 | hiredman | yes |
| 16:06 | {aaron} | ok |
| 16:07 | hiredman | you can use the io! macro |
| 16:07 | hiredman | ,(doc io!) |
| 16:07 | clojurebot | "([& body]); If an io! block occurs in a transaction, throws an IllegalStateException, else runs body in an implicit do. If the first expression in body is a literal string, will use that as the exception message." |
| 16:07 | hiredman | but io! doesn't seem to be used much |
| 16:07 | {aaron} | i see |
| 16:07 | {aaron} | well, i guess it depends on whether the side effects are significant |
| 16:08 | {aaron} | i guess it's not really an "effect" |
| 16:08 | {aaron} | if i'm logging the time in a transaction, then i can't ensure the time is always going to be the same each try |
| 16:08 | hiredman | definitely not |
| 16:09 | hiredman | I think one possibility is to use an agent |
| 16:09 | hiredman | sends to agents inside a transaction don't happen until the transaction completes |
| 16:10 | hiredman | I believe the docs for agents also specify side-effect free functions, but it is common to ignore that |
| 16:10 | hiredman | ,(doc agent) |
| 16:10 | clojurebot | "([state] [state & options]); Creates and returns an agent with an initial value of state and zero or more options (in any order): :meta metadata-map :validator validate-fn If metadata-map is supplied, it will be come the metadata on the agent. validate-fn must be nil or a side-effect-free fn of one argument, which will be passed the intended new state on any state change. If the new state is unacceptable, the validate-fn |
| 16:10 | hiredman | hmm |
| 16:10 | hiredman | ,(doc send) |
| 16:10 | clojurebot | "([a f & args]); Dispatch an action to an agent. Returns the agent immediately. Subsequently, in a thread from a thread pool, the state of the agent will be set to the value of: (apply action-fn state-of-agent args)" |
| 16:10 | hiredman | I guess it doesn't specify that |
| 16:13 | {aaron} | i like the idea of be assured that functions can be side-effect free...but if there is no way to distinguish in the language...how do i know that mr. library author hasn't just implemented all of his library with the standard Java libraries and doesn't make guarantees about side-effects? |
| 16:13 | hiredman | you don't |
| 16:14 | rsynnott | in general, trusting that the library author is infallible is probably a bit over-optimistic :) |
| 16:14 | {aaron} | so then does programming functionally gain me anything? i'm only as pure as the code i rely on |
| 16:14 | hiredman | clojure emphasizes functional style with immutable values, but does not enforce it |
| 16:14 | {aaron} | hmm |
| 16:15 | {aaron} | ok. in other languages i guess they enforce declaring side effects or something? |
| 16:15 | rsynnott | {aaron}: well, if the library author SAYS their functions are side-effect fre, you can trust them or not |
| 16:15 | hiredman | {aaron}: well, I am pretty sure the only one that does is haskell |
| 16:15 | {aaron} | i see |
| 16:15 | rsynnott | just as when a glibc author says that function X won't segfault, you can trust them or not |
| 16:15 | {aaron} | right ;) |
| 16:16 | Chousuke | {aaron}: if the library author claims a function is pure, and it turns out not to be, file a bug :P |
| 16:17 | {aaron} | ok, another question - does clojure itself, separate from Java libraries, have the notion of side-effects...or does it just rely on the JVM for all IO? |
| 16:17 | Chousuke | hiredman: doesn't haskell have UnsafePerformIO or something that allows you to override the type system? :/ |
| 16:17 | hiredman | Chousuke: no idea |
| 16:17 | Chousuke | I guess that's just an extension |
| 16:18 | hiredman | {aaron}: "just" is prejudicial, clojure is deigned to be integrated with the jvm |
| 16:19 | {aaron} | well, i'm trying to determine whether programming "only" in clojure guarantees pure functions...or whether there are intrinsically non-pure functions in clojure |
| 16:19 | Chousuke | there are. |
| 16:19 | {aaron} | (because then anything that imported stuff outside of clojure could automatically be labelled "dirty/sideeffects" |
| 16:19 | {aaron} | ok. |
| 16:19 | chouser | prn |
| 16:20 | chouser | builtin function that prints to stdout -- a side-effect. |
| 16:20 | Chousuke | but the host is such an integral part of the language that it doesn't make sense to consider Clojure without one :) |
| 16:20 | _ato | {aaron}: one of the main philosophies of Clojure is that pure-functional code, while having nice properties, is not always sufficient in a practical language. It allows side-effects but provides mechanisms (refs, atoms, agents etc) for making them safer. |
| 16:20 | Chousuke | it doesn't have to be the JVM though, but I guess that will always be the "main" Clojure host |
| 16:21 | {aaron} | ok. i assume the culture is such that when something *has* to have side effects, clojure authors typically make this pretty clear |
| 16:22 | Chousuke | hmm, well, you can use ! in naming :) |
| 16:22 | Chousuke | haphazardly mixing functional things and size effects just leads to bad code so it's implicitly discouraged :P |
| 16:24 | {aaron} | i see, that's what i was looking for |
| 16:24 | _ato | yep, usually it's either fairly clear from the context (eg you're doing IO or talking to a SQL database or something) or the ! naming convention is used. |
| 16:25 | {aaron} | cool |
| 16:25 | Chousuke | I think clojure actively tries to support a functional programming style rather than discourage any other style. |
| 16:26 | Chousuke | but a natural consequence is that imperative programming in clojure tends to feel out-of-place :/ |
| 16:26 | qbg | When using lein swank, the system classloader doesn't have the project on the classpath, so where can I find a classloader that does? |
| 16:27 | Chousuke | hmm, wasn't there some function to get Clojure's classloader? :/ |
| 16:28 | _ato | (clojure.lang.RT/baseLoader) IIRC |
| 16:32 | qbg | Yep, that works |
| 17:30 | technomancy | just tagged a Leiningen 1.1.0 release candidate: http://github.com/technomancy/leiningen/blob/master/NEWS |
| 17:31 | technomancy | would love to get some more eyes on it before the release |
| 17:31 | qed | technomancy: grabbing it right now |
| 17:31 | qed | thanks! :) |
| 18:29 | AWizzArd | rhickey: Is there a principle possibility to make insertion into sorted-sets (or maps) faster? Something like "transient sorted-sets" into which I insert elements guaranteed in the correct order? |
| 18:30 | AWizzArd | ,(let [x (range 300000)] (count x) (time (count (apply sorted-set-by < x)))) |
| 18:30 | clojurebot | 300000 |
| 18:30 | clojurebot | "Elapsed time: 7320.944 msecs" |
| 18:30 | AWizzArd | ,(let [x (range 300000)] (count x) (time (count (apply vector x)))) |
| 18:30 | clojurebot | 300000 |
| 18:30 | clojurebot | "Elapsed time: 92.089 msecs" |
| 18:33 | chouser | ,(let [x (range 300000)] (count x) (time (count (into [] x)))) |
| 18:34 | chouser | ,(let [x (range 300000)] (count x) (time (count (into [] x)))) |
| 18:34 | clojurebot | 300000 |
| 18:34 | clojurebot | "Elapsed time: 163.705 msecs" |
| 18:34 | chouser | ,(let [x (range 300000)] (count x) (time (count (into [] x)))) |
| 18:34 | clojurebot | 300000 |
| 18:34 | clojurebot | "Elapsed time: 132.526 msecs" |
| 18:35 | chouser | ,(let [x (range 300000)] (count x) (time (count (vec x)))) |
| 18:35 | clojurebot | 300000 |
| 18:35 | clojurebot | "Elapsed time: 86.965 msecs" |
| 18:35 | AWizzArd | also interesting |
| 18:35 | AWizzArd | vec and vector use transients under the hood i guess |
| 18:35 | hiredman | I doubt it |
| 18:36 | hiredman | I imagine they use to-array under the hood |
| 18:46 | mecolin | hello |
| 18:46 | chouser | hi |
| 18:47 | mecolin | i have these two snippets http://pastie.org/803512 |
| 18:47 | mecolin | how can i make the second snippet to evaluate in the first one ? |
| 18:49 | Raynes | There are a couple of pastebins that do Clojure highlighting specifically, including gist.github.com, paste.pocoo.org, ideone.com (also evaluates your code for you), and I think snipt.org does as well. |
| 18:49 | Raynes | Not that it matters all that much. Just sayin'. :) |
| 18:49 | chouser | what's read-file? but perhaps that doesn't matter -- you were hoping for the locals 'meta' and 'content' to be available to the code you're eval'ing? |
| 18:49 | mecolin | Raynes: thanks ;) |
| 18:50 | mecolin | chouser: I'd like to start off with snippet 2 to evalute in place of (eval tempalte) |
| 18:51 | chouser | have you tried 'load-file'? |
| 18:52 | mecolin | chouser: next, I'd like decorate it with content and meta data |
| 18:52 | mecolin | chouser: with 'load-file' i cannot achieve it, can i ? |
| 18:52 | chouser | correct, you cannot. |
| 18:52 | chouser | nor with eval the way you're going about it. |
| 18:53 | mecolin | can you give some clue how should i proceed ? |
| 18:53 | mecolin | s/give/give me |
| 18:53 | chouser | I think you'd have to read in the file and wrap it in (let [...] ...), then eval that let form. |
| 18:53 | chouser | ,(eval (read-string "(+ 10 foo)")) |
| 18:53 | clojurebot | DENIED |
| 18:54 | chouser | bah. anyway, that fails because foo is undefined |
| 18:54 | mecolin | ok |
| 18:54 | chouser | but this fails the same way: (let [foo 5] (eval (read-string "(+ 10 foo)"))) |
| 18:55 | chouser | this returns 15: (eval `(let [~'foo 5] ~(read-string "(+ 10 foo)"))) |
| 18:55 | mecolin | chouser: thanks ! |
| 18:55 | chouser | hm. you might have other problems though if the file you're reading in is doing 'ns' or 'in-ns' |
| 18:56 | mecolin | in fact, i'm doing it in the 2nd snippet |
| 18:58 | chouser | yes you are. trouble. |
| 19:06 | mecolin | chouser: if i defined a function in 2nd snippet (let's say: defn template), is there a way to switch different layouts in 1st snippet using :use but within render-template ? |
| 20:09 | qed | eeneeeeasd |
| 20:14 | ag90 | Hi. Does the Class/StaticField form work for static enums? |
| 20:16 | ag90 | I'm trying to access java.awt.TrayIcon.MessageType but it complains about not being able to find the class. I have improted (java.awt TrayIcon) but none of the following work: |
| 20:16 | ag90 | TrayIcon/MessageType/INFO |
| 20:16 | ag90 | TrayIcon.MessageType/INFO |
| 20:18 | arbscht | java.awt.TrayIcon$MessageType/INFO |
| 20:18 | ag90 | Oh great that works. |
| 20:18 | ag90 | Thanks |
| 20:40 | konr | Guys, why is this false? |
| 20:40 | konr | ,(= "44" (reverse "44")) |
| 20:40 | clojurebot | false |
| 20:40 | hiredman | ,(reverse "44") |
| 20:40 | clojurebot | (\4 \4) |
| 20:41 | hiredman | ,(= "44" '(\4 \4)) |
| 20:41 | clojurebot | false |
| 20:41 | hiredman | good? |
| 20:41 | konr | yes! thanks! |
| 20:43 | konr | the correct would be, then |
| 20:43 | konr | ,(= "44" (reduce str (reverse "44"))) |
| 20:43 | clojurebot | true |
| 20:43 | hiredman | apply str, not reduce |
| 20:43 | konr | Why? |
| 20:43 | clojurebot | why not? |
| 20:43 | hiredman | clojurebot: deep |
| 20:43 | clojurebot | It's greek to me. |
| 20:44 | hiredman | str uses a StringBuilder internally for multiple args (the apply case), the reduce case produces more intermediate garbage |
| 20:49 | ts00000 | anyone here with some clojureql clue? |
| 21:38 | jcromartie | would it make any reasonable sense to use a set with vectors as keys for two-dimensional data? |
| 21:39 | jcromartie | sorry, hash-map, not set |
| 21:40 | jcromartie | ,{[0,1] :foo [1,1] :bar} |
| 21:40 | clojurebot | {[0 1] :foo, [1 1] :bar} |
| 21:40 | jcromartie | it seems pretty natural |
| 21:40 | jcromartie | and it's sparse |
| 22:16 | chouser | jcromartie: sure, why not. |
| 22:16 | chouser | maybe a sorted-map, depending on how you intend to use it |
| 23:23 | mquander | i'd like to have a function that either takes a number n, a number n and a list of strings xs, and if i pass it a number n and a single string x, i'd like to treat that string as a list of one string |
| 23:23 | mquander | is there a nice way to do this? |
| 23:24 | mquander | oh nevermind |
| 23:24 | mquander | i figured out how to do it using apply |
| 23:34 | technomancy | given a var that's bound to a function and a list of arguments to apply, is there anyway to tell if the arity is correct by looking at the :arglists metadata? |
| 23:34 | technomancy | I mean a built-in function? |
| 23:35 | hiredman | ,(:arglists (meta #'+)) |
| 23:35 | clojurebot | ([] [x] [x y] [x y & more]) |
| 23:35 | technomancy | I guess it wouldn't be terribly hard to just figure it out with reduce |
| 23:35 | hiredman | ,(map count (:arglists (meta #'+))) |
| 23:35 | clojurebot | (0 1 2 4) |
| 23:35 | hiredman | or something |
| 23:36 | technomancy | trickier to do with varargs though, which is why I'd like something built-in |
| 23:37 | hiredman | ,(map #(if (.contains % '&) :vararg (count %)) (:arglists (meta #'+))) |
| 23:37 | clojurebot | (0 1 2 :vararg) |
| 23:52 | abrooks | I'm pretty sure that there's a way to type-hint a defn with its metadata but I'm failing to emit the right words into Google to find it. |
| 23:52 | abrooks | Oh, I want to type hint the type on the RETURN Value. |
| 23:54 | abrooks | Hm. I should looking core.clj... |
| 23:55 | abrooks | Ah... {:tag "[Ljava.lang.Object;"} |