#clojure logs

2015-07-01

00:00sharmsis it possible you declared value in a different namespace?
00:02tmtwdyeah
00:03tmtwdmy browser is connected and running the code fine, but as it turns out NO local expressions are available from the repl
00:03tmtwdI didn't realize
00:04justin_smithsharms: glad to hear that worked, yeah it sounded like a reduce to me
00:04tmtwdnow that I think about it, I suppose the problem lies somewhere with the repl
00:05justin_smithtmtwd: what namespace was value defined in?
00:05tmtwdreagent-test-app-jun29.core
00:05tmtwdohhh,
00:06justin_smithtmtwd: why would cljs.user namespace be able to see a value in reagent-test-app-jun29.core ?
00:06tmtwdhow do I call into the current namespace in a repl?
00:06tmtwdjustin_smith, good point
00:06tmtwd(use current-ns) or something?
00:06justin_smithtmtwd: you don't need to call into the current namespace. It's the one you are in. But you want to require, and optionally switch to, your owhter ns
00:07justin_smith*other
00:07tmtwdjustin_smith, from the repl?
00:07justin_smithtmtwd: yes
00:07justin_smithyour current ns in the repl is cljs.user
00:07justin_smithso you need to require the code defining your other ns
00:07tmtwd(require reagent-test-app-jun29.core) fails ...
00:08justin_smithtmtwd: it needs to be quoted
00:08justin_smithoutside the ns form you need (require '[reagent-test-app-jun29.core :as testapp])
00:08justin_smiththen you can access testapp/value
00:09justin_smithor after that you can use (in-ns 'reagent-test-app-jun29.core) - but make sure the namespace is required / fully loaded before doing that
00:12tmtwdokay lein figwheel is taking forever to start now ....
00:15tmtwd(require "reagent-test-app-jun29.core")
00:15tmtwdclojure.lang.ExceptionInfo: Library name must be specified as a symbol in :require / :require-macros; offending spec: [\e] at line 1 <cljs repl> {:file "<cljs repl>", :line 1, :column 1, :tag :cljs/analysis-error}
00:15tmtwdi get this error now
00:16tmtwdoh well thanks for your help, I'll figure this out later :)
00:16tmtwdgo to bed now
00:17justin_smithno, not a string!
00:17justin_smithtmtwd: you want a symbol
00:17justin_smith,(type 'foo)
00:17clojurebotclojure.lang.Symbol
00:17justin_smith,(type "foo")
00:17clojurebotjava.lang.String
00:18justin_smithTFW you type exactly the thing that would work and they try some other random thing
00:20l34ch(type "foo")
00:20l34ch,(type "foo")
00:20clojurebotjava.lang.String
00:20l34ch,(println "hi")
00:20clojurebothi\n
00:21l34ch,(eror "hi")
00:21clojurebot#error {\n :cause "Unable to resolve symbol: eror in this context"\n :via\n [{:type clojure.lang.Compiler$CompilerException\n :message "java.lang.RuntimeException: Unable to resolve symbol: eror in this context, compiling:(NO_SOURCE_PATH:0:0)"\n :at [clojure.lang.Compiler analyze "Compiler.java" 6543]}\n {:type java.lang.RuntimeException\n :message "Unable to resolve symbol: eror in this co...
00:21l34ch,(map inc [1 2 3 4 5])
00:21clojurebot(2 3 4 5 6)
00:21l34ch,(map inc (repeat 5))
00:21clojurebot(6 6 6 6 6 ...)
00:23l34ch,(loop [x 1] (recur (inc x)))
00:23clojureboteval service is offline
00:24l34ch,(:foo {:foo "wow"})
00:24clojurebot"wow"
00:26TEttingertmtwd: you want a symbol, as in single quote before a variable-like name, not a string
00:26TEttingercredit to justin_smith
00:26TEttinger(require 'reagent-test-app-jun29.core)
00:27tmtwdah cool
00:27tmtwdTEttinger, justin_smith thanks
00:27TEttinger(inc justin_smith)
00:27lazybot⇒ 268
04:04echo-areaYay! 1.7.0 is released.
04:09mmeixyes, we were witnessing yesterday when puredanger changed the Topic in #clojure to "Currently 1.7" :-)
04:43noncomwhere's the apropos function? http://dev.clojure.org/jira/browse/CLJ-1191 never saw that, and it is not present in my installation of clojure 1.7.0...
04:44noncom,(doc apropos)
04:44clojurebot"([str-or-pattern]); Given a regular expression or stringable thing, return a seq of all public definitions in all currently-loaded namespaces that match the str-or-pattern."
04:45noncomhere it works, but not in my repl...
04:47echo-areanoncom: I see it is in clojure.repl
04:47noncomah..
04:50noncomnow that i have upgraded to clojure 1.7.0, each time i start a repl, i get a couple of warnings:
04:50noncom;; Clojure 1.7.0
04:50noncomReflection warning, clojure/data/priority_map.clj:215:19 - call to method equiv on java.lang.Object can't be resolved (no such method).
04:50noncomReflection warning, clojure/core/memoize.clj:72:23 - reference to field cache can't be resolved.
04:50noncomis it normal?
04:50noncomthe namespaces that generate these warnings belong to clojure itself...
05:02PupenoI’m new to Clojure and I want to modify some libraries I’m using. Is this the correct procedure: cloning them from github, running lein install and then just using it normally in my project. Or should I do something different?
05:07cflemingjustin_smith: https://github.com/evancz/error-message-catalog is a great idea, similar to what you were thinking about for errors
05:45schmirPupeno_: this will work.
05:46schmirPupeno_: but you may like to use a repository manager like nexus in the long run where you host your patched versions
06:01Pupeno_What's the function that given a sequence gives you another empty sequence of the same type?
06:14schmir,doc empty
06:14clojurebot#error {\n :cause "Can't take value of a macro: #'clojure.repl/doc"\n :via\n [{:type clojure.lang.Compiler$CompilerException\n :message "java.lang.RuntimeException: Can't take value of a macro: #'clojure.repl/doc, compiling:(NO_SOURCE_PATH:0:0)"\n :at [clojure.lang.Compiler analyze "Compiler.java" 6543]}\n {:type java.lang.RuntimeException\n :message "Can't take value of a macro: #'clojure....
06:15schmir,(doc empty)
06:15clojurebot"([coll]); Returns an empty collection of the same category as coll, or nil"
06:25tdammersare there any crucial behind-the-scenes differences between def and let wrt laziness?
06:25tdammersI have this piece of code that relies on varargs being passed as a lazy sequence
06:25tdammersI map apply over that list, and then filter it
06:27zphdsIs there a way, I can add a type hint to a compojure route? "/foo/:id", Is there a way I can cast id as a integer somehow?
06:28zphdsdoing it in a let form myself is a bit cumbersome... Was wondering if there is a better way
06:54tdammershttps://gist.github.com/tdammers/e3fc0d2f92c10b8f4d20
06:54tdammers^ this is sth that currently baffles me somewhat
06:56tdammersI would expect calling the output of (foo) directly and calling it through a def-bound variable should produce identical behavior
08:44justin_smithcfleming: oh, nice
08:57noncomtdammers: that's interesting
09:01tdammersnoncom: we've roughly figured out what's happening by now
09:01tdammers"lazy" doesn't mean "guaranteed to be evaluated as late as possible", it just means "not guaranteed to be evaluated as early as possible"
09:02tdammersand based on those guarantees, clojure seems to use different data structures to represent varargs lists depending on the situation
09:02tdammersand their respective strictness properties bleed into the map and filter calls
09:03noncomtdammers: are you sure?
09:03CookedGryphonCan anyone think of a good reason why clojure's exception throwing (via sneakyThrow perhaps) couldn't capture locals - it would be so ridiculously helpful for debugging, knowing exactly what *data* caused the issue, rather than just the line of code
09:03noncomtdammers: these a bit changed lines show that the functions were processed differently: https://www.refheap.com/104664
09:03justin_smith,(apply (fn [[x & _]] x) (range)) ; tdammers is this related to what you are talking about?
09:03clojurebot#error {\n :cause "Java heap space"\n :via\n [{:type java.lang.OutOfMemoryError\n :message "Java heap space"\n :at [java.lang.Long valueOf "Long.java" 577]}]\n :trace\n [[java.lang.Long valueOf "Long.java" 577]\n [clojure.lang.Numbers num "Numbers.java" 1738]\n [clojure.lang.Numbers$LongOps incP "Numbers.java" 552]\n [clojure.lang.Numbers incP "Numbers.java" 116]\n [clojure.core$inc_SINGLE...
09:06tdammersnoncom: yes, but does that explain why the first one prints nothing and just returns nil, while calling (blah) prints "NONONO" and returns nil?
09:09justin_smithtdammers: fyi fn always has an implicit do
09:09justin_smith,((fn [] :a :b :c))
09:09clojurebot:c
09:09tdammersjustin_smith: yeah, keep forgetting that :D
09:13tdammersnoncom: some food for thought: https://gist.github.com/tdammers/9e7954f75d6e0aed1220
09:13justin_smithtdammers: aha! that answers it
09:13nikki93_how does the compiler differentiate between a ~@ splice in a ` versus a ~ with a @ inside (for a deref)? is the assumption that you don't deref stuff at compile time?
09:14justin_smithtdammers: chunked items are not realized individually - they are realized in groups
09:14tdammersyes, I know
09:14tdammersI just misinterpreted what "lazy" means in this context
09:14justin_smith,(first (map #(doto % print) (range)))
09:14clojurebot00
09:14justin_smithoh!
09:14justin_smithnot chunked any more
09:14noncomnikki93_: you would not write ~@my-var to deref a, say, future. you would write @~my-var
09:15tdammersthe full laziness that I relied on was an implementation detail
09:15justin_smith,(first (map #(doto % print) (vec (range 1000))))
09:15clojurebot0123456789101112131415161718192021222324252627282930310
09:15nikki93sorry my internet is pretty bad. did someone say something
09:15noncomnikki93: you would not write ~@my-var to deref a, say, future. you would write @~my-var
09:15noncom(inside a macro)
09:16noncomso that first you ~ and only then @
09:16noncomnot vice versa
09:16nikki93hmm
09:16noncomnikki93: see, the full form: (deref ~my-var)
09:16noncom@ is a shortcut for (deref ...)
09:19noncomnikki93: and, btw, that's the reader, not compiler that deciphers the text. so you can look at the reader source and see how things happen there
09:19nikki93got it
09:22noncomjustin_smith: tdammers: so you've figured, that was about laziness not guaranteed?
09:23tdammersnoncom: the way I see it, whenever things are documented to be "lazy", then that means I have to take into account that they may not be strict, but I cannot rely on them being fully lazy
09:24tdammersnoncom: based on this definition of "lazy", I was relying on implementation-defined behavior, and that behavior changed within the allowed range
09:45justin_smiththe definition of "lazy" includes chunking behavior
09:45justin_smithso it is never guaranteed to be maximally lazy
09:46justin_smithif you need to short circuit for correctness, use delays, not laziness (delays can be explicitly forced, and are never implicitly realized)
10:06justin_smithor, you know, a macro like cond or or
10:26tmtwdhttp://pastebin.com/eN8AESzU how come the second header is displayed on line 7 but not the first header on line 5? (cljs)
10:32snowelltmtwd: You're setting the "value" property of the h1 instead of the content
10:32snowellTry making the {:value @myval} a function call instead of a property map
10:32tmtwdeg?
10:32snowellEr, a deref: [:h1 @myval]
10:33tmtwdsnowell, thanks :) working now
10:33snowellnp
11:29PupenoWhat’s the equivalent of (require ‘(foo.bar)) when declaring a namespace (that is, no alias)?
11:31justin_smithPupeno: why would declaring a namespace involve an alias of any sort?
11:31justin_smithPupeno: also, you can do (require 'foo.bar) for that
11:32Pupenojustin_smith: but what's the syntax when passing it to ns?
11:32justin_smith(:require foo.bar)
11:32justin_smithor (:require [foo.bar])
11:32justin_smithor (:require (foo.bar))
11:32justin_smithin order of preference
11:33PupenoAh... I had a misplaced square bracket. Thanks .
13:36amalloyjustin_smith: (:require (foo.bar)) is a no-op, right
13:37steffen`Is there any current guide/tutorial how to get started with clojure and emacs? Which emacs package do I use? SLIME?
13:44wasamasanope
13:44wasamasait's CIDER now that they've separated themselves from the CL packages
13:56justin_smithamalloy: he was talking about within the ns form
13:56amalloyjustin_smith: right, me too
13:56amalloy() is for prefix lists
13:57justin_smithOK, but in the ns form, that would require the ns wouldn't it? It's terrible, and unidiomatic, but I think it would actually work
13:57amalloy,(require '(foo.bar.slam.whatever))
13:57clojurebotnil
13:57amalloy,(require '[foo.bar.slam.whatever])
13:57clojurebot#error {\n :cause "Could not locate foo/bar/slam/whatever__init.class or foo/bar/slam/whatever.clj on classpath."\n :via\n [{:type java.io.FileNotFoundException\n :message "Could not locate foo/bar/slam/whatever__init.class or foo/bar/slam/whatever.clj on classpath."\n :at [clojure.lang.RT load "RT.java" 449]}]\n :trace\n [[clojure.lang.RT load "RT.java" 449]\n [clojure.lang.RT load "RT.java"...
13:57justin_smithoh, wow
13:57justin_smithOK, TIL, thanks
13:58amalloyjustin_smith: remember, (:require (foo.bar a b c)) requires three namespaces, so (:require (foo.bar)) requires zero
13:58justin_smithahh...
13:58justin_smithI forgot about that syntax
14:29ambrosebsBronsa: I'm trying to figure out how tools.analyzer.jvm 0.6.7 decides which method a given host call resolves to. Does it even care about the tags of the arguments?
14:30ambrosebsBronsa: seems to just pick a random method based on target tag or return type and then forget about it
14:30ambrosebsspecifically: how do I figure out which method it will resolve to?
14:32Bronsaambrosebs: by host call you mean :host-call?
14:32ambrosebssay a :instance-call
14:32Bronsaright, are you asking what is the algorithm t.a.jvm uses to figure out which method to pick?
14:33ambrosebsright, analyze-host-expr seems to not do much picking
14:33ambrosebslike how do you know which overload to pick?
14:34Bronsaambrosebs: it's done in the validate pass, see validate-call
14:35ambrosebsah that helps.
14:36Bronsaambrosebs: it's quite complex and doesn't 100% match the clojure algo, I need to fix that some time
14:36ambrosebsall I want is a function that takes a :instance-call node and returns a clojure.reflect.Method
14:36Bronsaneither algo works 100% of the times, they have different edge cases.
14:36Bronsaambrosebs: ah, eastwood has that, one sec
14:37ambrosebscore.typed had one but upgrading from 0.3.0 broke it.
14:37Bronsahttps://github.com/jonase/eastwood/blob/master/src/eastwood/passes.clj#L11-L91
14:40ambrosebsBronsa: also is the best way to skip the `trim` pass to rebind run-passes?
14:40ambrosebsassuming I haven't turned core.typed into a pass in itself
14:41Bronsayes
14:41ambrosebscool
14:41Bronsaambrosebs: do you plan on doing that? turning core.typed into a pass?
14:41ambrosebsyes
14:41ambrosebs2 passes
14:41Bronsathat's cool
14:42ambrosebsyes :)
14:42Bronsaambrosebs: not *everything* can be done using the pass scheduler but it should be featureful enough for core.typed
14:43ambrosebsI just want the first pass to run before the second, then have trim run after.
14:44ambrosebsfirst pass is collect annotations, second is type check
14:44rhg135c.t as a t.a.j pass sounds cool
14:45ambrosebsright now it's an elaborate library pretending to be something more :P
14:46Bronsawell to be fair it was written before t.a.j was even a thing and the port happened way before t.a had the pass architecture it has now
14:51justin_smith(inc eastwood)
14:51justin_smithandyf_: that tool just keeps saving my ass
14:56ambrosebsBronsa: is reflect-validated a pass I can give to the scheduler?
14:58digiorgihi! How can i tell leiningen where is a local project dependency?
14:59Bronsaambrosebs: yeah just add {:pass-info {:walk :any :depends #{#'validate}}} to the var's meta
15:00Bronsafor whatever reason eastwood doesn't run their custom passes via t.a's scheduler
15:00BronsaI guess it just never got rewritten
15:03snowell1digiorgi: :repositories {"local" ~(str (.toURI (java.io.File. "/path/to/your/stuff")))}
15:03ambrosebsBronsa: is there a pass somewhere to tag each AST with a UUID?
15:03ambrosebs*node
15:04BronsaI think arrdem might have one
15:04snowellNo clue why I was snowell1…I must have gotten caught up in that netsplit earlier
15:05Bronsaambrosebs: uhm no, doesn't seem like so
15:07ambrosebscool
15:11arrdemIs there call for such a pass? I've been playing with that exact idea for a while.
15:20digiorgihow can i make the functions in a namespace private?
15:22snowelldigiorgi: Use defn- instead of defn
15:23arrdemdigiorgi: more generally add the ^:private metadata to your defs. That's what defn- does anyway.
17:13nikki93_wow the clojure implementation is actually... quite understandable
17:13justin_smithnikki93_: though the indentation in the java files leaves a bit to be desired
17:13nikki93_yeah it's pretty weird
17:14nikki93_looking at SyntaxQuoteReader right now while I was reading the clojure programming book
17:14nikki93_I was like, "wait, it's open source, why don't I just dig in" then jumped to 'read' docs and dug into source :D
17:16nikki93_it's cool to look at some of the old commmits like "incorporate bigint"
17:21wasamasaI'm still shocked how much more java it is
17:21wasamasamust be its verbosity
17:24treelzebubJoy of Clojure? I'm reading that right now. It's surprisingly entertaining for a programming text :)
18:24lvhAnyone know of issues with clj-http's web server + ring-defaults? I'm seeing https://gist.github.com/lvh/04a7d0aec0db8d47998b
18:24lvhThat exception happens before any of my routes are matched against, apparently
18:24lvhit looks like it's trying to call String methods on a keyword, which obv doesn't work
18:25lvhI don't know why I'm getting keyword headers
18:25arrdemlvh: IIRC ring will keywordize at least known headers
18:26arrdemmaybe all headers
18:26lvhwhaa? but then ring.middleware.content-type is totally broken, right?
18:27lvhoh, wait, hang on
18:27lvhthat handles responses, not requests
18:49nikki93_treelzebub: sorry were you asking me if I was reading Joy of Clojure?
18:58treelzebubnikki93: yeah :) was just curious. i'm really liking it so far
18:58nikki93ah I was talking about 'clojure programming' earlier
18:58nikki93but I'm also reading joy of clojure. it's a good 'philosophy' book to read alongside others
18:59nikki93particularly alongside hickey's talks on state in clojure, and reading about FRP etc.
18:59treelzebubcan rarely go wrong by reading an O'Reilly text. i will check it out!
18:59treelzebubyeah, i have also been watching hickey's videos
19:00nikki93man I wish syntax-quote fixed blah# gensyms to properly do what I mean in nested syntax-quote forms
19:01nikki93like when you jump 'up and down' syntax-quote levels and use x#
20:27zophywhat are they using with eclipse with clojure code ?
20:28zophyi use emacs myself, and web search shows a lot of references to counterclockwise
20:28zophyfor eclipse
21:05mr_rmI don't quite understand why if i type this in the repl (http://www.pastebin.ca/3042913) I don't see a new value of @foo print out. Can someone please explain?
21:06TEttingermr_rm: I think because you're in an infinite loop?
21:06TEttingerwhenever you call (forever) , it won't go past that...
21:07BronsaTEttingermaybe you should wrap forever in a future?
21:07mr_rmTEttinger: however i do get a repl prompt that i can change the atom in
21:07Bronsaerr, mr_rm
21:07mr_rmi wasn't sure how the repl was running that loop
21:07mr_rmseems like it's spinning it off on a thread
21:07mr_rmbecause repl is still active
21:08mr_rmdoes nrepl create a whole separate process for that?
21:09TEttingerthat's an odd one, I wouldn't think that it would still allow input
21:09mr_rmi'm in ccw (eclipse) which let's me continue to type input to the repl while the loop is printing stuff
21:09mr_rmwhen i tell ccw to stop the loop, the atom is set to the incremented value
21:09mr_rmit's like it's running two separate processes
21:10mr_rmthat's why i got confused by it :)
21:11TEttingerI just tried it in lein repl, it does not allow input and just prints "foo = 0" over and over
21:12TEttingerI think telling it to stop the loop happens before the swap!
21:12zophymr_m while it ios looping and accepting keyboard input can you run other code ?
21:13mr_rmhere is the thing... i can't see the output while i keep incrementing the atom (in this case) but when i tell ccw to break, the atom is set to the new value. maybe ccw is batching up the additional input
21:13mr_rmtthen running it all at once after the loop breaks
21:13mr_rmi definitely can keep typing in commands and i see the output from them after breaking the loop
21:14mr_rmi don't see additional java processes. maybe it's just batching it.
21:14mr_rmqueueing up the input
21:14zophyhow greatly does the atom increment ?
21:15mr_rmas many times as i run (swap! foo inc) while the loop is running
21:15zophyoh, yeah, foo is globali see
21:15mr_rmright
21:16zophyi wonder how that would run not in the repl
21:17zophyi assume it would print everything out, but it would take another program thread to do the swap!, i thinl
21:17mr_rmi inc'd a couple of times, then i did (* 5 5), the new incremented atom values printed out, along with 25, after i broke the loop
21:18zophyrepl's are tricky in many ways
21:18mr_rmi actually didn't think it would accept the input at all while the loop was running. figured it was something that i just didn't about but maybe it's normal
21:19zophybut your thread is running :)
21:20mr_rmbut the input was just being run on a different thread along with the loop, why isn't the loop thread seeing the changes to the atom?
21:21mr_rms/^but the/but if the/
21:21zophylike you said it must be caching the output
21:22mr_rmi think so now. tricky :)
21:22zophydon't know if it's the way java does it's threads or if it's the repl itself doing that
21:23mr_rmmust be the repl. java isn't going to magically spin up threads by itself
21:23zophyi've been waiting for a clojure guru to tell us all about this, where are you guru's ?
21:24mr_rmoh wait... the repl is running in a diff process than eclipse with ccw. it's sending my input to the remote nrepl to process and then displays the output. but if the nrepl is busy with that loop, ccw MUST be caching my input
21:24mr_rmthat would explain it
21:25zophyi make it a habit to restart my cider repl and test my code without the repl, cider/nrepl isn't very helpful with namespace re-compiling dependencies
21:27zophyall that programmer convience magic is powerful and it takes caution on my part
21:28mr_rmi already used eclipse with java quite a bit (not much lately) so i just tried Counterclockwise (ccw) for Eclipse. it's pretty nice and i have no complaints about it at all. i was just screwing around with this example.
21:28zophyi was going to setup eclipse for myself this evening, never used it
21:31mr_rmthere is an nrepl plugin for Atom that i was interested to try but it's very primitive compared to ccw (can only send highlighted text to the nrepl). and as a long time vi user, i found it really hard to get used to the weird key mappings in emacs :)
21:31mr_rmso i stuck with eclipse
21:32mr_rmit really works great but it's kind of a pig, lots of RAM and sometimes will get slow for no apparent reason.
21:38zophyfor the way i work, i use either emacs or gvim, i don't really need such a large collaborative structure as an ide like eclispe provides
21:41mr_rmzophy: yeah... we're very enterprisy :) and long ago standardized on maven and eclipse so new devs could immediately jump in and build stuff. it has the maven glue, the repository plugins, plus groovy and java support so i'm used to it anyway
21:42mr_rmi tried using maven for my clojure builds but that was just too painful
21:43mr_rmit worked, and i have some groovy/java/clojure all-in-one sample projects with maven, even using ejbs lol a true mongrel from hell
21:44mr_rmthere was more xml config than code
21:50justin_smithmr_rm: code is data! data is code!
21:52mr_rmjustin_smith: yes, i did plenty of Ant too, so i know that xml can be code as well! (sure glad those days are over)
21:58justin_smithit was meant to be a dumb lisp joke, but sure, that too
21:59mr_rmyeah, i got it. was going for an equally dumb rejoinder :D
22:00justin_smithas long as we're all dumb
22:00mr_rmlol
22:21gfredericksanybody know how terminals work? I'm wondering why STDIN seems to get things a line at a time, and if that's customizable
22:22rpauloan empty list evaluates to true in clojure? hmm...
22:22gfredericksrpaulo: yes
22:23gfredericksoh I bet this is exactly what readline is all about eh?
22:24rpaulogfredericks: is CL the only lisp that evaluates () to false?
22:24gfredericksrpaulo: not sure about scheme
22:24rpauloscheme is the same as clojure
22:24rpauloI just tested with s48
22:25gfredericksrpaulo: lists are a bit less fundamental in clojure; e.g., there are other first-class collections, so for () to be false you'd have to decide if [] and #{} and {} are false as well
22:25gfredericksnot to mention all the second-class collections and on and on
22:26gfredericksI don't think readline is my problem
22:29amalloygfredericks: you need to put your tty in raw mode if you want characters one at a time, i think
22:30amalloyor maybe that is for getting control characters
22:30gfredericksamalloy: is this the part where I finally have to figure out what a tty actually is precisely?
22:30amalloyi still haven't, really. every so often it matters for a brief while and i learn a little bit
22:31gfredericksI think it probably stands for "Terminal, terminal, yeah?"
22:33amalloywell of course it is teletype, since that is what we all use in the modern era
22:44justin_smithamalloy: you type, something happens far away, the latin checks out
23:03seangroveI'm using test.check, and I have gen-english-surnames and gen-japanese-surnames. I'd like to make a generator the will randomly sample from either
23:04seangroveAh, maybe gen/frequency
23:05reiddraperseangrove: yeah, exactly what you want
23:05seangrovereiddraper: So nice, so nice.
23:05seangroveSorry I asked, didn't see page 2 until just then
23:08reiddraperseangrove: no problem at all
23:09seangroveOverall really appreciating test.check for lots of different cases
23:09seangroveWouldn't mind seeing core.typed/test.check/schema all folded into one though
23:09seangroveOr rather, folded into a single notaion
23:09seangroveBut I'm sure you've heard that before...
23:12reiddraperseangrove: yeah, no doubt it would be nice in theory, i'm not optimistic it would work in practice though
23:13reiddraperseangrove: gfredericks is working on things more day to day than myself lately, so he can ponder :)
23:13seangroveHeh, fair enough
23:13reiddraperi'm mostly writing haskell now...
23:13seangroveI was just going to ask about QC's ability to do it, actually
23:13seangroveIt seems Haskell is able to leverage a lot of the type info
23:14seangroveWhy Haskell though?
23:14reiddraperSuppose that's both a simple and a complex question to answer... the short answer is because that's what i'm doing in my job
23:15reiddraperthe longer answer will have to wait for another time, i've got to head out, but happy to chat later if you're curious
23:16seangroveCertainly curious, yes, but happy to wait for another time
23:17seangroveSo this looks like it's not the way to generate minimum-length strings: (gen/sample (gen/such-that #(> 10 (count %)) gen/string) 100)
23:29gfredericksseangrove:
23:29gfredericksnope
23:29gfrederickshave to be careful with such-that
23:31gfredericksseangrove: I don't think we have anything for customizing the sizing of strings, but gen/string is just defined as (gen/fmap clojure.string/join (gen/vector gen/char))
23:31gfredericksso it's easy to tweak the call to gen/vector to customize its size
23:34gfredericksseangrove: also the schema-gen library can be an okay way to generate generators from schemas