2011-01-10
| 01:10 | TakeV | How well does the .NET port of Clojure work? |
| 01:19 | cheezey | does drop-last have some weird side effect |
| 01:20 | cheezey | cuz after i try to conj a list that's been drop-lasted, it conjs backwards :\ |
| 01:20 | cheezey | if that makes any sense |
| 01:21 | amalloy | &(doc drop-last) |
| 01:21 | sexpbot | ⟹ "([s] [n s]); Return a lazy sequence of all but the last n (default 1) items in coll" |
| 01:21 | amalloy | cheezey: it conjs to the front of the list, just like it does to every list |
| 01:22 | amalloy | &(conj (drop-last 2 (range 10)) 1) |
| 01:22 | sexpbot | ⟹ (1 0 1 2 3 4 5 6 7) |
| 01:22 | cheezey | whoops, i meanet to say cons* |
| 01:22 | amalloy | the only thing that ever conjs to the end is a vector: ##(conj (vec (drop-last 2 (range 10))) 1) |
| 01:22 | sexpbot | ⟹ [0 1 2 3 4 5 6 7 1] |
| 01:23 | amalloy | cheezey: doesn't matter. cons glues onto the head too |
| 01:23 | amalloy | &(cons 10 (range 2)) |
| 01:23 | sexpbot | ⟹ (10 0 1) |
| 01:27 | cheezey | let's see.. |
| 01:27 | cheezey | &(conj [0 1] 2) |
| 01:27 | sexpbot | ⟹ [0 1 2] |
| 01:27 | cheezey | &(conj (drop-last [0 1]) 2) |
| 01:27 | sexpbot | ⟹ (2 0) |
| 01:28 | cheezey | i guess i don't get it :| |
| 01:28 | amalloy | cheezey: ##(class [0 1]) ##(class (drop-last [0 1])) |
| 01:28 | sexpbot | (class [0 1]) ⟹ clojure.lang.PersistentVector |
| 01:28 | sexpbot | (class (drop-last [0 1])) ⟹ clojure.lang.LazySeq |
| 01:29 | amalloy | vectors are the *only* thing that adds at the end, and once you do something lazy to it like drop-last, you don't have a vector anymore |
| 01:30 | cheezey | oh ok. |
| 01:31 | amalloy | &(class (seq [0 1])) |
| 01:31 | sexpbot | ⟹ clojure.lang.PersistentVector$ChunkedSeq |
| 01:31 | amalloy | &(conj (seq [0 1]) 2) |
| 01:31 | sexpbot | ⟹ (2 0 1) |
| 01:33 | TakeV | So, protocols are interfaces, and records are classes, essentially? |
| 01:33 | cheezey | amalloy: is there a way to "revector" them o_O |
| 01:34 | amalloy | cheezey: sure, but you're blowing your performance to hell if you do that |
| 01:34 | amalloy | see instead ##(doc subvec) |
| 01:34 | sexpbot | ⟹ "([v start] [v start end]); Returns a persistent vector of the items in vector from start (inclusive) to end (exclusive). If end is not supplied, defaults to (count vector). This operation is O(1) and very fast, as the resulting vector shares structure with the original and no trimming is done." |
| 01:34 | amalloy | TakeV: umm. more or less, but if you try to translate an OOP program using those rules you'll be in for pain and you'll be missing the point of clojure |
| 01:36 | cheezey | hey amalloy the lists are going to be like a maximum of size 10 |
| 01:36 | cheezey | im ok right :P |
| 01:37 | amalloy | cheezey: if you don't care about performance, just use concat |
| 01:37 | cheezey | oh |
| 01:38 | amalloy | and it will probably be more efficient than going to and from vectors over and over |
| 01:40 | amalloy | cheezey: the fact that this is getting complicated should make you reconsider whether you're doing it the right way |
| 01:41 | cheezey | amalloy: i would like to drop the last element from a list and be able to append to it |
| 01:41 | cheezey | i dunno how much simpler it could get. |
| 01:42 | amalloy | cheezey: i mean, why it is you want to be able to do that. but hey, if that's what you need to do, then concat and (drop-last and/or take) are your friends |
| 01:42 | cheezey | amalloy: i guess you can think of it as a stack O_o? |
| 01:43 | cheezey | honestly, it doesn't matter if it's the front or back as long as im adding/removing from the same side.. |
| 01:43 | amalloy | cheezey: so conj onto a subvec, or cons onto a sublist |
| 01:48 | cheezey | ahhh.. i just realized im doing other stuff with the list |
| 01:48 | cheezey | i guess i need to get the first/last (again, only need to "modify" one side though) |
| 01:48 | cheezey | and "rest" in both ways |
| 01:49 | tufflax | (assoc v i (inc (v i))) <- is this really the best way to increase an element in a vector by 1? |
| 01:50 | amalloy | tufflax: update-in |
| 01:50 | amalloy | &(update-in [1 2 3] [1] inc) |
| 01:50 | sexpbot | ⟹ [1 3 3] |
| 01:51 | tufflax | thanks |
| 01:53 | cheezey | anyway, thnx amalloy im not used to clojure obv |
| 01:53 | cheezey | =P |
| 02:00 | TakeV | amalloy: Oh yes. It seems like a good tool to have, not something one should pidgin hole everything into though. |
| 02:01 | amalloy | TakeV: protocols are largely for performance and interop. for general-purpose clojure code, multimethods are more flexible |
| 02:01 | Clinteger | no, please pigeonhole everything |
| 03:02 | notsonerdysunny | Can I suppress the repl in slime printing the return value by default? |
| 03:05 | LauJensen | amalloy: Im thoroughly disappointed to see people in here asking questions about ClojureQL which you are unable to answer *frown* |
| 03:06 | amalloy | LauJensen: i'm a rebel |
| 03:06 | LauJensen | You're incompetent |
| 03:07 | LauJensen | (crude joke, sorry, hope you're not weeping now) |
| 03:08 | amalloy | LauJensen: i'm running out of tissues |
| 03:08 | LauJensen | amalloy: So sorry - I'll make a blogpost flaming Scala if that'll cheer you up |
| 03:08 | amalloy | *laugh* that sounds fantastic |
| 03:08 | notsonerdysunny | I remember the return values of expressions evaluated in the repl were automatically bound to some vars.. |
| 03:08 | amalloy | maybe i'd learn something about scala |
| 03:08 | notsonerdysunny | what are those vars .. google isn't helping .. |
| 03:08 | amalloy | *1 |
| 03:09 | notsonerdysunny | thanks amalloy |
| 03:09 | notsonerdysunny | can I suppress the return values from being automatically printed ... |
| 03:10 | LauJensen | notsonerdysunny: (do (your form) nil) |
| 03:10 | notsonerdysunny | right now I add a (def _ s-exp) to achieve that... |
| 03:10 | amalloy | notsonerdysunny: you just want to do a bunch of stuff with side effects? |
| 03:10 | amalloy | (= (whatever)) |
| 03:10 | notsonerdysunny | yes right .. I am just interested in the debug prints .. |
| 03:11 | notsonerdysunny | printing the return value is just flooding the repl ... |
| 03:13 | notsonerdysunny | why isn't *1 showing up when I do a (ns-publics *ns*) |
| 03:13 | amalloy | it's not an interned var |
| 03:14 | amalloy | it's a repl convenience |
| 04:18 | rrc7cz | how do you guys feel about translating http error responses (client 4XX or server 5XX) into typed RuntimeExceptions (e.g. BadGatewayException) for a REST client lib? |
| 04:25 | AWizzArd | rrc7cz: my first thought would be that this introduces unnecessary complexity. |
| 04:26 | LauJensen | rrc7cz: Would make some code easier, ie. assuming everything goes well and just catch exceptions instead of testing on the result |
| 04:28 | rrc7cz | so I'm not considering it for Clojure clients of the lib. I use conditions and I like it |
| 04:28 | rrc7cz | I throw a map like {:status 422, etc} and I can have my handle-case dispatch on :state instead of :type |
| 04:29 | rrc7cz | but I'm thinking about how Java clients should be supported by the library. And having them catch a single Condition type isn't very friendly |
| 04:29 | rrc7cz | thinking of the Java code, i think it would be best to have something like "catch (BadGatewayException e)... catch (NotImplementedException e).." |
| 04:30 | rrc7cz | right now I have an abstract HttpException which extends RuntimeException and contains a factory which accepts a status code and returns an instance of the correct exception. |
| 04:31 | rrc7cz | Basically I'm thinking I'll have my core clojure code w/condition, then a sort of Java wrapper which translates those conditions to this set of exceptions |
| 04:37 | AWizzArd | rrc7cz: When you return a record or map that contains all data, then the users of your lib can just have a look into that record or map. |
| 04:41 | Fossi | i think exceptions are ugly for http statuses |
| 04:41 | Fossi | after all it's a valid outcome of a request |
| 04:41 | Fossi | would hate to have to catch all of those |
| 04:41 | Fossi | especially being RuntimeExceptions might screw up your program quite a lot |
| 04:42 | Fossi | loads of users will never catch those |
| 04:43 | AWizzArd | Yes, in principle each request needs to be embedded in a try/catch where the catch will have to list all 60 return codes. |
| 04:46 | Fossi | well, or just one class those extend from, but still |
| 04:47 | AWizzArd | A simple map or record could do well. |
| 04:59 | rrc7cz | a map or record is fine for clojure clients, but I'd hate to have a Java client have to parse a map |
| 04:59 | rrc7cz | no client would have to catch all of those exceptions; they're RuntimeExceptions for that very reason |
| 05:00 | rrc7cz | just catch what you care about, or catch a superclass like HttpException or ClientException (4XX) |
| 05:00 | AWizzArd | rrc7cz: It should be trivial to call get from Java on maps, or access public fields of a record. |
| 05:00 | rrc7cz | AWizzArd: sure, but then every usage of the lib forces the client to code for error conditions |
| 05:00 | rrc7cz | instead of giving them the freedom to ignore it, or to handle it higher up in the call stack |
| 05:01 | rrc7cz | I mean, I was thinking about error-as-return-type as well, like Maybe/Either in Haskell |
| 05:01 | rrc7cz | but what I don't like is that without pattern matching, it's kinda ugly forcing every client to check for these error conditions |
| 05:03 | rrc7cz | Fossi: it's a valid outcome for a request, but in a RESTful API it's also the mechanism by which to signal errors |
| 05:05 | Fossi | yeah, but you are trying to fix these problems (having to check for the error) in a non-java way |
| 05:06 | rrc7cz | here's a concrete example: POST to /user should create a new user at /users/1, where 1 is the PK of the user (just an example). But imagine POST is not actually allowed on /user because the API requires the client to specify a PK, so only PUT on /user/1 is supported. It will return a 405 Method Not Supported. That's useful and it's an invocation error. How would your client lib handle that? |
| 05:06 | Fossi | there simply is no maybe/either, there is (almost) no "handling it higher up the callstack" and there is no pattern matching |
| 05:06 | Fossi | those are not your/your library's faults, so don't try to cleverly fix em |
| 05:07 | Fossi | in your scenario the "user" would never try to invoke that |
| 05:07 | Fossi | and never handle that error |
| 05:07 | rrc7cz | actually looking at my example, I think it's a bad one because it shows a problem with the client lib rather than the data supplied to the client lib |
| 05:07 | rrc7cz | hm |
| 05:07 | Fossi | because i assume they would have documentation and remove "flawed" calls |
| 05:08 | Fossi | then again, if something changed unnoticed, i want to get thrown a "hard"/typed error |
| 05:08 | Fossi | so i can deploy a new version |
| 05:09 | Fossi | but on a more realistic senario, the api may be down/overloaded for a while |
| 05:09 | rrc7cz | it exception idea works in other contexts though. Look at JPA/Hibernate. If you try to persist() an entity whose PK already exists in the DB, you would get a RuntimeException |
| 05:09 | Fossi | i don't want that to throw me out of some loop, because i "forgot" to catch runtimeexception |
| 05:10 | Fossi | yeah and that is *horrible* in practice |
| 05:10 | rrc7cz | ? |
| 05:10 | Fossi | i rarely know anybody who hasn't complained about it once |
| 05:10 | Fossi | it's such a bad pattern |
| 05:10 | rrc7cz | how would you have designed it? |
| 05:10 | AWizzArd | rrc7cz: the clients are forced to implement *something* anyway if they want to react to errors. In some cases they want to write into a log file, in the other case a little Swing window should pop up, etc. |
| 05:11 | Fossi | that we almost always wrap it either by rethrowing a checked exception or not binding to it/using sql |
| 05:11 | Fossi | then again, if the DB is down, *that* is a useful case for an exception |
| 05:11 | rrc7cz | AWizzArd: correct, I'm just arguing that by making it a RuntimeException, you're giving the client the freedom to a) choose what to handle and what to ignore and b) where to handle it |
| 05:11 | Fossi | as in, somebody has to do something about it |
| 05:12 | Fossi | runtime exceptions will almost never be caught from my experience |
| 05:12 | Fossi | they will just fall through and cause somebody to be called late night |
| 05:12 | Fossi | just to notice an enduser fiddeled with a url on your site somewhere |
| 05:26 | rrc7cz | well the good news is, I'm writing the Java client code as well. So I'll try both approaches and see which one feels better/less painful |
| 05:27 | rrc7cz | I could end up with a compromise: just stick with clojure's condition lib and leave it to the Java code to catch a http error condition (4XX or 5XX) and parse the "status" field of the map themself if they care about handling a particular value |
| 05:27 | rrc7cz | that would save me from writing a big class hierarchy |
| 05:30 | rrc7cz | it's pretty quiet in the EU timezone :-) It seems it's usually only AWizzArd and Lau. Fossi where you located? |
| 05:31 | Fossi | Hamburg, DE |
| 05:32 | Fossi | generally picks up a few hours from now |
| 05:32 | Fossi | but lots of lurkers as well :) |
| 05:32 | rrc7cz | I have good memories of the fish market at 5am |
| 05:32 | Fossi | (including me usually) |
| 05:32 | rrc7cz | I miss currywurst :-( |
| 05:33 | rrc7cz | the best I ever had was in Hamburg, thought the smoked eel from the market was awesomet oo |
| 05:33 | Fossi | berlin is quite famous for currywurst |
| 05:33 | Fossi | but we have quite a few good ones here at well |
| 05:33 | rrc7cz | I tried it there too, but it wasn't as good. I had a native Hamburger host though so he knew where to go |
| 05:36 | mduerksen | *lurk* |
| 05:37 | rrc7cz | so it's up to 5 now :-) |
| 05:40 | LauJensen | Guys, you're making me sick with all this talk of German food :( |
| 05:41 | Fossi | german food is awesome |
| 05:41 | rrc7cz | :-D sorry, but I thought Danish food was basically the same, especially in the sea-front Hamburg |
| 05:41 | Fossi | actually danish food is quite nice as well |
| 05:41 | ejackson | don't complain - I have to eat English food. |
| 05:42 | rrc7cz | I imagine pickled herrring |
| 05:42 | rrc7cz | ejackson: you win. Blood pudding cannot be beat, even by the Germans |
| 05:42 | Fossi | yeah, english food sucks mostly :o |
| 05:43 | ejackson | just as well the the girls are so pretty here, or there'd be no reason to stay... |
| 05:43 | rrc7cz | ejackson: I hope you're joking... English girls??? |
| 05:43 | rrc7cz | good lord. You need to come here to the Czech Republic. I think you'd enjoy it :-) |
| 05:43 | ejackson | oh yeah... I'm joking :) |
| 05:49 | LauJensen | rrc7cz: Yea I wasn't boasting about the danish food culture :( And AFAIK the only pretty girl in the UK is ejackson :(( |
| 05:50 | ejackson | LOL ! yes, she's a stunner |
| 05:51 | rrc7cz | lol tragic |
| 05:51 | ejackson | actually I was drinking Gemmeldansk on saturday night, you have nothing to boast about ! |
| 05:51 | ejackson | and that was after the bizarrely named Fishshot, also from your part of the world LauJensen |
| 05:52 | LauJensen | ejackson: You mean Fishermans friend? |
| 05:52 | rrc7cz | Carlsberg is also terrible. |
| 05:52 | ejackson | well, Fishermen's friend is the solid phase, this was a liquid that tasted identical |
| 05:54 | LauJensen | ejackson: okay, I know which one you're talking about. Its very refreshing |
| 05:54 | ejackson | lol, it claimed on the bottle to be the most popular shot in the world, which was highly commendable lying. |
| 06:01 | krumholt | hi. i am looking for a function that retrives the first occurence of an element. i could use filter and first but i need the index and not the value |
| 06:05 | raek | krumholt: an exact function for that is not in core, but how to make it is explained in the first chapter of Programming Clojure: http://media.pragprog.com/titles/shcloj/flow.pdf |
| 06:05 | mrBliss | ,(.indexOf [1 2 3] 3) |
| 06:05 | clojurebot | 2 |
| 06:05 | raek | hrm |
| 06:06 | raek | there's no function wrapping that, right?? |
| 06:06 | LauJensen | ,(letfn [(find-idx [k c] (reduce #(if (= %2 k) %1 (inc %1)) 0 c))] (find-idx :y [:x :y :z])) |
| 06:06 | clojurebot | 2 |
| 06:07 | krumholt | thanks all |
| 06:08 | LauJensen | krumholt: wait, scratch that, reduce doesnt stop when it gets a hit |
| 06:10 | LauJensen | go with stu's |
| 06:13 | raek | (defn index-of [coll x] (some (fn [[idx val]] (when (= val x) idx)) (indexed coll)) ;; version using Stuart Halloway's indexed, but some instead of first + filter |
| 06:14 | raek | some has the advantage here that it can check for one thing and return another |
| 06:25 | LauJensen | pepijndevos: whats with the nick ? |
| 06:38 | pepijndevos | LauJensen: I'm trying to change it. |
| 06:39 | Raynes | pepijndevos: What trouble are you having doing so? |
| 06:40 | pepijndevos | Raynes: I'm not sure. It seems to work, but it still shows fliebel in some places |
| 06:40 | Raynes | pepijndevos: I'm going to spend the next week or so trying to figure out how to pronounce your name. |
| 06:41 | pepijndevos | Raynes: harhar, both ie an ij er pretty much Dutch sounds. Thoug i and y are close in some ways. |
| 06:41 | raek | I like the dutch "ij" |
| 06:43 | pepijndevos | I wonder what the relation is between nickname and user name. Colloquy now shows my nick to be fliebel, and user to be pepijndevos. |
| 06:44 | raek | in irc? |
| 06:44 | pepijndevos | raek: yes |
| 06:45 | raek | nickname is basically the only thing that's used |
| 06:45 | raek | the other fields (login and real name) is for /whois lookups |
| 06:46 | raek | currently, you are registered at nickserv as "fliebel". but that only affects channel admin stuff on freenode |
| 06:47 | pepijndevos | raek: So, I'm still registered as fliebel, but displayed as pepijndevos? |
| 06:47 | raek | yes |
| 06:48 | pepijndevos | okay, I can live with that :) |
| 06:48 | raek | I only saw the string "fliebel" in the whois lookup. nowhere else. |
| 06:49 | raek | pepijndevos: http://pastebin.com/hPyLFkuu |
| 06:51 | pepijndevos | raek: Thanks |
| 07:45 | AWizzArd | rhickey: Good morning. |
| 08:00 | AWizzArd | Swing users? When I grab the handles of my window and resize it manually to become bigger then my UI grows. But when I open a fresh JFrame with it and hit maximize then the components don't grow in x-direction. Any ideas? (.validate (.getContentPanel frame)) didn't help. |
| 08:01 | AWizzArd | nevermind |
| 08:02 | pepijndevos | AWizzArd: What was it? |
| 08:02 | Chousuke | Sounds like OS X |
| 08:04 | AWizzArd | pepijndevos: was Windows XP with MigLayout. ML will only resize automatically in x direction if *all* column constraints contain a "[grow]". |
| 08:05 | pepijndevos | MigLayout... I've heard a bit about it, but never used it. Is it good? |
| 08:07 | AWizzArd | It is indeed very good. It basically removes the need for all other Layouts that come with Swing. |
| 08:11 | StartsWithK | http://paste.pocoo.org/show/317723/ can some one tell me is this a bug in clojure? (if it was already anwsered, i'm sorry didn't see it) |
| 08:14 | raek | the first one looks weird... |
| 08:15 | raek | as for the second exception: it seems like remove-ns does not remove used vars and aliases from other namespaces |
| 08:16 | raek | (those can be done manually with ns-unmap and ns-unalias) |
| 08:16 | raek | if that is intentional, I do not know |
| 08:58 | pepijndevos | What is the state of logic programming in Clojure? There are 2 mini kanrens and one hadoop lib, as far as I know. |
| 08:59 | kumarshantanu | pepijndeos: Fogus is working on unification library, did you consider that already? |
| 09:03 | pepijndevos | kumarshantanu: No, where does it live? |
| 09:06 | dakrone | pepijndevos: https://github.com/clojure/core.unify |
| 09:07 | LauJensen | pepijndevos: that link to my website you put on HN yesterday, just left the frontpage minutes ago :) |
| 09:08 | pepijndevos | LauJensen: ASCII version of your stats of the past day: /^^^^\__ |
| 09:08 | LauJensen | (and generated about 15 - 16.000 hits) |
| 09:08 | pepijndevos | dakrone: I just arrived there as well, thanks :) |
| 09:15 | pepijndevos | But, core.unify does not do the rule thing that datalog does, or does it? |
| 09:18 | kumarshantanu | datalog can go hit a data source (on the disk), which is interesting |
| 09:19 | pepijndevos | kumarshantanu: But, can I do the classic family relations in core.unify? I don't think I understand unification completely yet... |
| 09:20 | kumarshantanu | core.unify lets you only unify vars and values...it doesn't know about facts AFAICT |
| 09:23 | LauJensen | ejackson: heads up! I think your blog has stalled :( |
| 09:31 | pepijndevos | Whoa, another one! http://clojure.github.com/clojure-contrib/datalog-api.html |
| 10:08 | dsop | hmm how to check if an obj implements a certain type created with deftype? |
| 10:08 | dsop | ah satisfies |
| 10:08 | tonyl | (type obj) |
| 10:08 | tonyl | maybe |
| 10:12 | cemerick | dsop: instance? is what you're looking for. satisfies? checks whether a type has been extended to a protocol |
| 10:19 | markskilbeck | In the Programming Clojure book, it says "Avoid direct recursion." What's the difference between direct and indirect recursion? |
| 10:20 | Chousuke | markskilbeck: indirect just means using recur |
| 10:21 | Chousuke | You shouldn't do recursion "directly" by calling the function because that causes stack growth. |
| 10:21 | dsop | as clojure doesn't have a tail-call optimization |
| 10:22 | Chousuke | I think it actually depends on the JVM |
| 10:22 | Chousuke | if the JVM guaranteed TCO then Clojure wouldn't need recur, but it unfortunately doesn't :/ |
| 14:10 | mprentice | ok, got it working now, thanks for the help qbg and technomancy |
| 14:26 | Berengal | Two things: First, I love how many "magic" things are implemented using macros. Makes it very easy to see how they're implemented. Second, my very preliminary proxy-mocking code already feels like I'm not only dissecting objects, but removing most of the organs and replacing them with a very steampunk machinery of ratchets, coils and spring, including a cockpit for me to sit and drive in. |
| 14:34 | pepijndevos | Berengal: Have you figured out a default-proxy macro already? :) |
| 14:35 | Berengal | pepijndevos: just create an "empty" proxy, and use init-proxy to add functions to it |
| 14:36 | pepijndevos | Berengal: I mean, the abstract-subclass thing you asked for earlier. |
| 14:37 | Berengal | pepijndevos: As in create a subclass of an abstract class, not just an instance to it? |
| 14:38 | markskilbeck | What's the difference between when and if? |
| 14:38 | qbg | when has only a true branch and allow for multiple forms in it |
| 14:38 | pepijndevos | Berengal: I don't know. You asked about something for poking at Java and generating stub classes. |
| 14:38 | Berengal | pepijndevos: Ah, that's what I'm working on |
| 14:39 | Berengal | And init-proxy is how I create the stubs |
| 14:40 | markskilbeck | qbg: Ah! Bitte. |
| 14:52 | pepijndevos | Can I say I hate function - and macros even more - that take &rest arguments? Sure, I can use apply and reduce for most, but not with macros. |
| 14:53 | qbg | Why don't you like & arguments on macros? |
| 14:54 | qbg | If your writing a macro that expands to a macro usage, just use ~@ |
| 14:56 | amalloy | and if you were writing a function that uses a macro with & args, you couldn't do it anyway - the arguments to the macro would have to be known at compile time as literals anyway |
| 14:57 | pepijndevos | amalloy: Exactly. |
| 14:57 | amalloy | pepijndevos: i think you missed my point. macros can't really take a seq of arguments |
| 14:58 | amalloy | try rewriting a macro from (defmacro foo [a & more]) to (defmacro foo* [a more]) and you'll have the same problem |
| 14:58 | amalloy | so i don't see what you think would be an improvement |
| 15:01 | pepijndevos | amalloy: *rereads everything, again, and again* I don't get it... |
| 15:01 | amalloy | pepijndevos: maybe i'm the one who doesn't get it |
| 15:02 | amalloy | could you give an example of a macro with a &rest argument that causes you problems? |
| 15:02 | pepijndevos | amalloy: Uuhm, let me thing, I think Enlive had a few. |
| 15:04 | pepijndevos | amalloy: There. They make me want to resort to (eval (macroexpand)) tricks sometimes. https://github.com/cgrand/enlive/blob/master/src/net/cgrand/enlive_html.clj#L554 |
| 15:07 | amalloy | pepijndevos: and how would you propose improving this? (defmacro transformation [forms]) won't be any good. not knowing anything about this library, the sheer number of macros-instead-of-functions makes me nervous, but i don't think there's anything wrong with the macros themselves other than (possibly) the fact that they're macros |
| 15:10 | pepijndevos | amalloy: That is the solution, tell people to stop using macros, and tell them someone at the other end of the globe is going to hate them when he needs to jump through hoops to make their macro run with a seq of arguments. |
| 15:11 | amalloy | pepijndevos: that's fine. it's just you're complaining about macros with & arguments, when really what's bothering you seems to be macros |
| 15:14 | pepijndevos | amalloy: Macros are fine it's just that sometimes I want to stuff a seq of arguments through one, and it can't be done. There is no solution to it, I just don;t like it. |
| 15:16 | qbg | I suspect that using what ever macro you are trying to use wouldn't really make sense at runtime anyways |
| 15:17 | opqdonut | I think it's good style to offer function versions of macros where possible |
| 15:18 | qbg | I think Enlive already has functional versions of a lot of things already |
| 15:18 | qbg | After all, it was used in CGrand's (not= DSL macros) talk IIRC |
| 15:18 | pepijndevos | I once had a mega-macro that did a lot and was very messy, but when I broke it up in functions, I could not get all the ends tied together, and resorted to this. It was temporarily, but then the project stalled. https://github.com/pepijndevos/utterson/blob/develop/src/utterson/compile.clj#L76 |
| 15:20 | pepijndevos | qbg: iirc I had to dig deep down to find a function for what I did, but that was a looong time ago. |
| 15:32 | mduerksen | what could be the reason i need to use gen-class in 1.3, while i didn't need it in 1.2? |
| 15:38 | mduerksen | hmm, gen-class didn't work either - ClassNotFoundException during runtime |
| 16:08 | mduerksen | interesting - when compiled with lein-stable, everything works fine. |
| 16:12 | _na_ka_na_ | hellos, how do i create a non-top level var |
| 16:14 | _na_ka_na_ | intern will create a top (ns) level var |
| 16:14 | tonyl | you can use let |
| 16:15 | amalloy | _na_ka_na_: do you actually mean var, as in like #'foo, or do you just want a local binding? |
| 16:15 | _na_ka_na_ | amalloy: a var |
| 16:15 | amalloy | _na_ka_na_: i don't think you can do that |
| 16:16 | amalloy | and it's not really clear why you would want to. if you want a binding, you have let; if you want mutability, you have atoms/refs |
| 16:17 | _na_ka_na_ | amalloy, i want to keep a var of my app's compojure routes, so i can change it dynamically, i would have gladly used an atom if it worked |
| 16:18 | tonyl | just rebind the symbol of the var to a new var |
| 16:18 | amalloy | _na_ka_na_: use a closure around an atom? |
| 16:19 | amalloy | (let [real-route (atom whatever)] (set-compojure-routes-function (fn [] (@real-route)))) |
| 16:19 | amalloy | note that i don't know anything about compojure so the actual words i used there are nonsense, but i hope you get the idea |
| 16:21 | _na_ka_na_ | amalloy, i dont understand what you mean |
| 16:22 | amalloy | _na_ka_na_: if you want something that you can rebind, but don't want to create a top-level var (which is the only kind of var), you can create an atom that stores the real data, and pass that around / modify it as needed |
| 16:22 | _na_ka_na_ | so routes is just a function .. say. . (def *routes* (fn ...)) .. then here's how i'll start the server .. (start *routes*) |
| 16:23 | _na_ka_na_ | and inside compojure will just call the function as (*routes* request) |
| 16:23 | _na_ka_na_ | so if I start my server as : (start (var *routes*)) .. I can rebind it and changes will be reflected |
| 16:24 | _na_ka_na_ | is is because ((var some-fn) ..) works .. |
| 16:24 | _na_ka_na_ | ,((var +) 1 2) |
| 16:24 | clojurebot | 3 |
| 16:24 | amalloy | yes, i'm aware |
| 16:25 | amalloy | aside from the fact that i don't know why you want to avoid creating a var, you can close around an atom and then swap/reset the atom |
| 16:25 | _na_ka_na_ | but i'm not aware of any utility as 'set-compojure-routes-function' |
| 16:26 | _na_ka_na_ | i'm just being fussy .. i want to avoid a top level name coz its not really required |
| 16:26 | _na_ka_na_ | I'll just do (declare *routes*) |
| 16:29 | _na_ka_na_ | aren't vars reference types like atoms/refs/agents, why can't we create them like we do the others? |
| 16:31 | chouser | you can craete vars using with-local-vars |
| 16:32 | amalloy | chouser: no kidding? neat |
| 16:33 | _na_ka_na_ | chouser, but it works only if used from the same thread |
| 16:33 | _na_ka_na_ | ,(with-local-vars [a 10] (future (var-get a))) |
| 16:33 | clojurebot | #<core$future_call$reify__5500@1e60601: :pending> |
| 16:33 | _na_ka_na_ | ,(with-local-vars [a 10] @(future (var-get a))) |
| 16:33 | clojurebot | java.util.concurrent.ExecutionException: java.lang.IllegalStateException: Var null/null is unbound. |
| 16:36 | amalloy | _na_ka_na_: what i'm talking about is this: https://gist.github.com/b4ff52ae5f0d50db15bd |
| 16:36 | chouser | works in 1.3 :-) |
| 16:36 | _na_ka_na_ | yeah i know :/ even binding is multithreaded in 1.3 |
| 16:37 | chouser | but of course it's unbound in another thread. That's how vars work. |
| 16:37 | chouser | ,(with-local-vars [a 10] @(future (with-bindings {a 20} (var-get a)))) |
| 16:37 | clojurebot | 20 |
| 16:38 | _na_ka_na_ | amalloy, nice i understand now ! |
| 16:38 | _na_ka_na_ | thanks |
| 16:38 | amalloy | imo this is a disgusting solution and you should just use vars like god intended |
| 16:38 | amalloy | but if you don't want to, there's the answer |
| 16:39 | _na_ka_na_ | hmm you're right, I'll just use a var, I was just curious about creating a var like other reference types |
| 16:40 | chouser | Well, this isn't Clojure-related, but it's what I was up to this weekend: http://blog.n01se.net/?p=237 |
| 16:41 | _na_ka_na_ | chouser, that-is-awesome |
| 16:41 | chouser | :-) thanks. Surely it's been done before, but it was fun to make myself. |
| 16:45 | _na_ka_na_ | do we have a 1.3 clojure-bot ? |
| 16:45 | _na_ka_na_ | i think it may be useful |
| 16:45 | _na_ka_na_ | to have a bot running latest beta |
| 16:45 | _na_ka_na_ | or alpha |
| 16:46 | amalloy | _na_ka_na_: we don't |
| 16:47 | amalloy | chouser: fwiw, it works on my droid x, but only with one finger |
| 16:47 | amalloy | if i use two fingers, neither one draws anything |
| 16:47 | _na_ka_na_ | amalloy, can i help create one in any way |
| 16:48 | amalloy | _na_ka_na_: http://github.com/Raynes/sexpbot - just change the dependencies to use whatever clojure version you want, and run it on your computer |
| 16:49 | amalloy | you'll probably want to (surprise!) read the readme, which has a pretty good getting-started guide |
| 16:52 | _na_ka_na_ | amalloy, I'll take a look |
| 17:14 | Raynes | Assuming sexpbot will run on 1.3 |
| 17:14 | Raynes | Never actually tried. |
| 17:15 | Raynes | I intend to make it so we can evaluate code in both 1.2 and 1.3 from the same bot using classlojure. |
| 18:06 | david` | hi |
| 18:06 | david` | anyone here work at Relevance |
| 18:06 | david` | by chance |
| 18:09 | redinger | david`: Several of us do, what's up? |
| 18:09 | david` | oh, I was thinking of applying |
| 18:10 | david` | I was emailing with someone named Andrew but I don't see that person on the site |
| 18:10 | redinger | david`: Ah, cool; Yeah, we don't have Andrew up there |
| 18:11 | david` | oh ok |
| 18:11 | david` | thanks redinger |
| 18:11 | david` | are you going to the Ruby meetup on the 18th? |
| 18:11 | redinger | Sure am |
| 18:11 | david` | nice! |
| 18:12 | redinger | We also have the TriFunc meeting tomorrow in our office. Aaron's speaking |
| 18:12 | david` | oh really |
| 18:12 | david` | I've never heard of ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAnkld+J8ySCvnjBPXcNpFlnI6TIZvLcdFgw0mdMNeW/rIdUNNQBQuC4QXv+P2WhnECS9m1tJV2SvvyvGnjOz1RkUTIucrolskhwxu2cr50eThb7vvH9xBVTIZ4nWoaorTAaThqN8KZYmRGyl3g9oP2ROipDBIR4qaHtutGj4vjXcRr9pG8GCDx0JUy8xZjGDGKa1fcbH65vUkytbRwIkZfHB0AI2XNejbaZ8lTOofXZ74eWpZVwsI15Fhn6AqOtjl1Df3PSoKVutWNY2ksXt0FlMOaC9Mp4MqqTAw/B8AyJ1bf4uD3ugDC4jDXhyATL9A5Xyt2LYpVRRSzL+HNK4Zww== david@darthmaul |
| 18:12 | david` | fuck |
| 18:12 | david` | TriFunc |
| 18:12 | david` | copy and paste on ubuntu sucks |
| 18:13 | david` | oh cool, aaron = incanter |
| 18:14 | david` | I was reading up on Incanter this past weekend |
| 18:14 | redinger | Aaron's talking about incanter. David L = incanter |
| 18:14 | david` | oh ok |
| 18:14 | redinger | The TriClojure group is also kicking off tomorrow (at TriFunc): http://www.meetup.com/TriClojure/calendar/15938227/ |
| 18:15 | david` | awesome, I was thinking about how there was no Functional meetup group in the triangle |
| 18:15 | Raynes | redinger: Did you ever get my reply to your email? |
| 18:15 | david` | I was talking to one of my coworkers about starting one |
| 18:16 | redinger | Raynes: I did, thanks for getting back go me! |
| 18:16 | redinger | s/go/to |
| 18:16 | sexpbot | <redinger> Raynes: I did, thanks for getting back to me! |
| 18:16 | Raynes | Just making sure my email client didn't decide he hated me. |
| 18:18 | Raynes | redinger: For the record, there is a new draft that you'll want to grab before reading it. Recently made a huge move to pandoc and fixed a lot of things in the earlier chapters. Read page 5 of that new draft before anything else, it'll give you a feel for the status of the book. |
| 18:18 | Raynes | Same link (always the same link). |
| 18:18 | Raynes | Prettier fonts. :> |
| 18:18 | redinger | Cool, I'll take a look through it |
| 18:19 | Raynes | I have a friend who has agreed to copy edit it, so I'm doing well in the editing and review department. |
| 18:56 | bytecolor | how would I bring java.lang.Math/cos into my namespace so I can (cos x, not (Math/cos x)? I've tried all manner of :use, :import, :require, etc. |
| 18:57 | Raynes | You can't. |
| 18:57 | bytecolor | oh? well that's interesting |
| 18:57 | Raynes | What you want to do is create a function that wraps it. |
| 18:57 | Raynes | (defn cos [x] (Math/cos x)) |
| 18:57 | Raynes | Then you can just call your own function. |
| 18:57 | bytecolor | aye, I see |
| 18:58 | raek | this can be used too http://richhickey.github.com/clojure-contrib/import-static-api.html |
| 18:58 | Raynes | raek: Stop stealing my spotlight. |
| 18:58 | Raynes | ;) |
| 18:58 | raek | :-) |
| 18:58 | Raynes | First time I've heard of import-static. |
| 18:58 | bytecolor | I thank you both equally ;) |
| 18:59 | Raynes | <3 |
| 18:59 | raek | (inc Raynes) |
| 18:59 | sexpbot | ⟹ 3 |
| 18:59 | Raynes | (inc raek) |
| 18:59 | sexpbot | ⟹ 3 |
| 18:59 | amalloy | get a room, guys |
| 19:00 | tonyl | imported as macros, wonder if there is an option for importing as fn |
| 19:00 | raek | import-static could be updated to emit a definline instead |
| 19:09 | rata_ | hi |
| 19:09 | rata_ | how do you get a unique temporary file in clojure? |
| 19:09 | amalloy | &(java.io.File/createTempFile "pre" "suff") |
| 19:09 | sexpbot | java.lang.SecurityException: Unable to create temporary file |
| 19:10 | amalloy | ,(java.io.File/createTempFile "pre" "suff") |
| 19:10 | clojurebot | java.lang.SecurityException: Unable to create temporary file |
| 19:10 | amalloy | bah. but rata_, ^ |
| 19:10 | rata_ | thanks amalloy =) |
| 19:11 | rata_ | do you use that with with-open? |
| 19:12 | amalloy | rata_: do whatever you want with the File object it gives you |
| 19:13 | rata_ | I ask that because I don't know how to use a File object |
| 19:14 | raek | rata_: if you want to read text, create a Reader. if you want to read raw bytes, create a InputStream. |
| 19:14 | raek | rata_: you can use 'reader' and 'input-stream' from clojure.java.io to do that |
| 19:14 | raek | they can both take a File object as argument |
| 19:15 | raek | (require '[clojure.java.io :as io]) (import 'java.io.File) |
| 19:15 | rata_ | can I use c.c.duck-streams/write-lines? |
| 19:15 | raek | (with-open [rdr (io/reader (File/createTempFile ...))] ...read here...) |
| 19:16 | raek | sure |
| 19:16 | raek | some of the stuff in c.c.duck-streams has migrated into c.j.io and core |
| 19:17 | rata_ | I didn't know about c.j.io |
| 19:17 | rata_ | is it in 1.3? |
| 19:17 | raek | 1.2 |
| 19:18 | raek | (if you want to write, you use a writer or a output-stream) |
| 19:20 | rata_ | thanks |
| 19:21 | rata_ | I just want to write-lines on it and then launch a command line program that reads it |
| 19:22 | rata_ | how do I manually close a File object? I doesn't have a .close method |
| 19:23 | raek | the "File" class name is a bit confusing. a File actually represents a file name, rather than an opened file |
| 19:24 | raek | calling 'writer' on the File object will create a FileOutputStream under the hood, which will open the file |
| 19:24 | raek | Writers and OutputStreams have a .close method, though |
| 19:27 | rata_ | oh, thanks raek =) |
| 20:19 | Derander | raek: I swear your name is a nosql db or something |
| 21:58 | cheezey | is it possible to apply map to a function with more than one variable |
| 21:58 | cheezey | (or somehow consolidate two lists together..) |
| 21:59 | brehaut | ,(map (fn [a b] [a b]) [1 2 3] [:a :b :c]) |
| 21:59 | clojurebot | ([1 :a] [2 :b] [3 :c]) |
| 21:59 | brehaut | like that? |
| 21:59 | cheezey | oh my god that's totally not what the docs say LoL |
| 21:59 | cheezey | i prolly should have just tried it out :\ |
| 22:00 | brehaut | the docs are a wee bit obtuse, but they do say that to me? |
| 22:00 | amalloy | cheezey: that is what the docs say |
| 22:00 | amalloy | &(doc map) |
| 22:00 | sexpbot | ⟹ "([f coll] [f c1 c2] [f c1 c2 c3] [f c1 c2 c3 & colls]); Returns a lazy sequence consisting of the result of applying f to the set of first items of each coll, followed by applying f to the set of second items in each coll, until any one of the colls is exhausted. An... http://gist.github.com/773949 |
| 22:00 | cheezey | oh. i misread it fffuuu |
| 22:00 | cheezey | i suck at reading guys. |
| 22:00 | amalloy | btw brehaut, ##(map vector [1 2 3] [:a :b :c]) is easier :P |
| 22:00 | sexpbot | ⟹ ([1 :a] [2 :b] [3 :c]) |
| 22:01 | brehaut | amalloy: yeah i almost did that, but figured the explicity function is clearer |
| 22:01 | amalloy | brehaut: maybe so |
| 22:25 | cemerick | There was a clojure lib floating about that automated (somewhat saner) microbenchmarking. Anyone remember the name? |
| 22:37 | cmeier | I just watched Rich Hickey's demo with the ant colony - it rocked my world |
| 22:37 | cmeier | Looking for the actual code ... does anyone know if it is available? |
| 22:38 | brehaut | it used to be |
| 22:39 | brehaut | it has been a very long time since i looked for it; its pre-1.0 code |
| 22:39 | amalloy | cmeier: http://clojure.googlegroups.com/web/ants.clj |
| 22:40 | brehaut | (inc amalloy ) |
| 22:40 | sexpbot | ⟹ 1 |
| 22:41 | cmeier | amalloy: thanks! |
| 22:59 | cemerick | I did a bit of irresponsible microbenchmarking, probably going to write up a blog post for fun. Does any of this look fishy to anyone? https://gist.github.com/d3e652e87d76796ab05c |
| 23:00 | cemerick | The map v. HashMap result seems plausible, but the vector v. ArrayList result doesn't. |
| 23:01 | qbg | I wonder how ArrayList is implemented |
| 23:01 | cemerick | it's just a wrapper around an array, which is why I have to think the result is wrong |
| 23:01 | cemerick | An array dereference can't be slower than a tree traversal, no matter how shallow. |
| 23:02 | cemerick | and yet… |
| 23:03 | amalloy | $source get |
| 23:03 | qbg | I wonder how they compare if you add the items to the ArrayList manually |
| 23:03 | sexpbot | get is http://is.gd/kwSz3 |
| 23:04 | amalloy | cemerick: the arraylist has to go through several more hoops in RT.get |
| 23:07 | amalloy | apparently because get is intended for associative things, which arraylist is not |
| 23:07 | amalloy | cemerick: try replacing (get) in your benchmark with (.get) - that may be more viable |
| 23:08 | cemerick | I just did -- *much* more sensible. |
| 23:08 | amalloy | good! |
| 23:09 | amalloy | tbh i don't see how (get) works at all on an arraylist, from reading Rt.java |
| 23:09 | cemerick | good catch, thanks -- I wrote it for the map test, and just blindly reused it |
| 23:10 | brehaut | cemerick: how much faster does it get? |
| 23:10 | cemerick | Yeah, neither do I. It's got to get to nth somehow, but the second clause in the conditional surely is false for ArrayLists. |
| 23:11 | amalloy | cemerick: yeah, i'm baffled |
| 23:13 | cemerick | brehaut: using .get, (t _ 1e6) is 10.5s for the vector, 5.2s for the ArrayList. |
| 23:14 | cemerick | That seems entirely plausible (and not damn bad for the vector IMO). |
| 23:14 | brehaut | cemerick: cheers; i tried to run it but did something dumb and my repl died |
| 23:17 | cemerick | Interestingly, the same "benchmark" is consistently ~1s faster for the arraylist under 1.3.0-alpha4. |
| 23:20 | cemerick | ,(get (java.util.ArrayList. (range 5)) 0) |
| 23:20 | clojurebot | nil |
| 23:20 | cemerick | amalloy: ha-ha! ^^ :-P |
| 23:20 | amalloy | ah. it doesn't work :P |
| 23:20 | amalloy | i thought i'd tried that, but i see now that i didn't |
| 23:20 | cemerick | We got tarred on that one. |
| 23:20 | cemerick | jeez, there since 2008! https://github.com/clojure/clojure/commit/1c9de854a30e116e502c2d0bebaadce8f80219fb |
| 23:21 | cheezey | im doing (map f (map b l) l) where b is a buffer, f is some function and l is a list of numbers |
| 23:21 | cheezey | and f seems to never be called ;x |
| 23:21 | cheezey | er sorry |
| 23:21 | cheezey | b is not a buffer |
| 23:22 | cheezey | b is an associative array (integer -> string) |
| 23:22 | qbg | cheezey: map is lazy |
| 23:22 | qbg | If you never use the result, nothing will be computed |
| 23:23 | cheezey | but it looks like im using it :X (in f) |
| 23:23 | Scriptor | cheezey: what you need? |
| 23:23 | qbg | You can use doall/dorun to force computation |
| 23:24 | qbg | If this is for side effects only, doseq might be a better choice |
| 23:28 | Raynes | cheezey: "lazy" means that none of the function calls that create the new sequence are evaluated until you actually use them. By use them, I mean try to get them out of the collection. |
| 23:28 | cheezey | qbg: can i use doseq with multiple sequences |
| 23:28 | cheezey | because it does not seem like i can D: |
| 23:28 | qbg | In a nested fashion yes; in a parallel fashion not as easily |
| 23:28 | Raynes | Not like you can with map. |
| 23:29 | cheezey | Raynes: yea. i thought by passing it to a function, it would count but i guess not |
| 23:29 | qbg | ,(doseq [[x y] (map list (range 10) (range 10 20))] [x y]) |
| 23:29 | clojurebot | nil |
| 23:29 | qbg | ,(for [[x y] (map list (range 10) (range 10 20))] [x y]) |
| 23:29 | clojurebot | ([0 10] [1 11] [2 12] [3 13] [4 14] [5 15] [6 16] [7 17] [8 18] [9 19]) |
| 23:29 | qbg | ^ That is just nasty though |
| 23:29 | Scriptor | somewhat random question, does anyone know what rich hickey used to make his presentations? I need something that can embed code |
| 23:31 | cemerick | Pretty sure he uses keynote. |
| 23:31 | cemerick | Not sure what's used to do the code highlighting. I doubt it's builtin. |
| 23:31 | cheezey | qbg: what do you mean by nasty. inefficient? |
| 23:32 | qbg | Not very beautiful |
| 23:32 | amalloy | disgusting |
| 23:32 | cheezey | well is it worse than (dorun (map .. |
| 23:32 | cheezey | ? |
| 23:34 | Scriptor | argh, dammit my client lagged out |
| 23:34 | Scriptor | sorry to bother, but if there were any responses to my question, could someone repost them? |
| 23:35 | cemerick | Pretty sure he uses keynote. |
| 23:35 | cemerick | Not sure what's used to do the code highlighting. I doubt it's builtin. |
| 23:35 | Scriptor | hmm |
| 23:35 | qbg | You can also embed code in Beamer |
| 23:36 | Scriptor | don't have much experience with latext, unfortunately |
| 23:37 | cemerick | "and the LaTeX shall rise again" eh ;-) |
| 23:37 | cheezey | Scriptor: i think beamer makes the presentation pretty easy even if you don't know latex |
| 23:38 | Scriptor | cheezey: really? I'm trying to find some docs for it now |
| 23:39 | qbg | You can cargo-cult it to a large degree |
| 23:41 | Raynes | cemerick: I recently migrated my entire book to markdown. Using pandoc to generate the latex and pdfs. :D |
| 23:41 | cheezey | Scriptor: i only used beamer like twice before but i think so. you might get frustrated by fixing small details since you're new to latex.. |
| 23:41 | Raynes | It's pretty cool. |
| 23:41 | cemerick | Raynes: That sounds very sane. :-) |
| 23:41 | cemerick | We're using asciidoc, which I've come to like quite a lot. |
| 23:41 | qbg | Hopefully it is markdown -> latex -> pdf and not just markdown -> pdf |
| 23:42 | Raynes | Of course, I still had to touch some latex (just a template) to get it precisely how I want it. |
| 23:42 | Raynes | qbg: Of course. |
| 23:42 | Raynes | How does that work out? |
| 23:43 | Raynes | Someone else typeset it for you? |
| 23:43 | cemerick | It's entirely automated. No latex in the process though, either. |
| 23:43 | cemerick | O'Reilly doesn't like latex much, AFAICT. They're big on semantic markup. |
| 23:43 | Raynes | asciidoc can, by itself, output that pretty? |
| 23:44 | Raynes | That's insane. |
| 23:44 | cemerick | no |
| 23:44 | cemerick | it's asciidoc - |
| 23:44 | cemerick | . |
| 23:44 | cemerick | bah |
| 23:44 | qbg | Didn't they use a lot of troff in the past? |
| 23:44 | cemerick | it's asciidoc -> docbook -> ???? -> PDF |
| 23:44 | Raynes | Oh, docbook. |
| 23:44 | Raynes | Pandoc can generate docbook as well. |
| 23:44 | Raynes | But, since I don't plan to publish with O'Reilly... LATEX! |
| 23:45 | cemerick | qbg: don't know about the history. The /Creator of our PDF proofs is "XSL Formatter", so I'll bet they're going from docbook -> FOP -> PDF |
| 23:47 | Raynes | I'm happy I found pandoc. |
| 23:48 | Raynes | markdown-mode + emacs + pandoc = Lyx being uninstalled. |
| 23:48 | Scriptor | hmm, I just found https://github.com/schacon/showoff |
| 23:48 | Scriptor | might just do the trick |
| 23:48 | qbg | I'm liking markdown a lot after using on the github wikis |
| 23:49 | Raynes | I have equally pretty (if not prettier) output and more control without the clunky and ugly Lyx WYSIWYG editor. |
| 23:49 | Scriptor | qbg: same here, it has pretty much everything you'd need to write some simple but good docs |
| 23:50 | Scriptor | using it with github pages is a sweet combo |
| 23:50 | amalloy | yeah, i have to say i've barely used markdown but it's pretty convenient |
| 23:50 | Raynes | schacon's Progit book was written using pandoc and markdown. |
| 23:50 | cemerick | As sad as it is, I can *never* remember the order of href/text in markdown links. Never. |
| 23:51 | qbg | Then again, I've always liked the simplicity of CLHS |
| 23:51 | cemerick | And if I get the order right, I mix up parens and brackets. |
| 23:51 | technomancy | it bothers me on some level that markdown is implementation-defined |
| 23:51 | technomancy | with an unmaintained implementation |
| 23:51 | Scriptor | cemerick: using it on reddit alot finally hammered it in :) |
| 23:53 | cemerick | technomancy: implementation_s_ in the plural. Every impl has its own little extensions. :-( |
| 23:54 | qbg | I wonder if there is support for blinking in at least on implementation... |
| 23:55 | Derander | qbg: doesn't markdown support arbitrary html? |
| 23:56 | qbg | I haven't used markdown much yet |
| 23:56 | Raynes | Yes, there is. |
| 23:56 | Raynes | You can embed HTML into it. |
| 23:56 | Derander | qbg: then yes, there is blink support :-) |
| 23:56 | Raynes | I've used <div style="center">some text</div> to center text in markdown before. |
| 23:56 | Derander | I wonder if there is a jquery plugin to add blink support to browsers that no longer include it |
| 23:56 | Raynes | align: center, even |
| 23:57 | Derander | I still use <center> occasionally |
| 23:57 | Derander | when I'm feeling really lazy |
| 23:57 | Derander | :-9 |
| 23:57 | Raynes | I was tempted, but figured I'd be better off to use the former. I only had to do it twice. |