Re: Inconsistency of dissoc on maps vs records?
On Friday, April 20, 2012 4:01:54 PM UTC+9:30, David Jagoe wrote: > > > On 20 April 2012 07:08, Matthew Phillips wrote: > >> I've always liked the way assoc and dissoc return the original map >> instance when there's no change to be made. But this is not apparently >> true of records. e.g.: > > > Out of curiosity, why is this useful to you? > > I would imagine that the fact that it works like that for maps at the > moment is an implementation detail that you shouldn't rely upon. > > dissoc[iate]. Returns a new map of the same (hashed/sorted) type, > that does not contain a mapping for key(s). > It's mainly that, when mentally reasoning about the performance of assoc and dissoc, I've been quite happy to say "this dissoc here will hardly ever actually need to *do* anything, thus have very little overhead GC-wise". This didn't turn out to be true of records, which was surprising. I haven't been impacted performance-wise, but it does seem like a missed optimisation opportunity: I'd be interested to hear if it's harder to do than I think in the record case. You're right that relying on identical? in code logic is a bad idea. Matthew. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: a library I'm working on for generating PDFs from Clojure
Hi all, Can anybody tell me whether wkhtmltopdf or flying-saucer deal with pagination properly? I've been templating TeX to get properly laid out tables broken over multiple pages. But of course I'd much rather just generate the PDFs from the HTML that I am already maintaining. Thanks, David On 20 April 2012 19:40, Tim Robinson wrote: > Also, wkhtmltopdf has worked well for me. > > http://code.google.com/p/wkhtmltopdf/ > > On Apr 20, 4:06 am, Patrick Wright wrote: > > Dmitri, > > > > you might look at delegating some of the effort to Flying Saucer, which > can > > generate PDFs when given clean HTML and CSS. > http://code.google.com/p/flying-saucer/ > > > > There is a blog somewhere (which is currently unreachable) of someone > using > > FS from Clojure. > > > > HTH, > > Patrick > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient with > your first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en > -- David Jagoe davidja...@gmail.com +447535268218 -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Term rewriting systems implemented in Clojure
A few years back I copied a small rewrite system from Scheme to Clojure while watching the SICP video lectures. It's a nice use case for a rewrite system. You can enter a mathematical function and the system will rewrite the function to its derivative. > > Perhaps this code plus the videos will help you to get started. You can find the code here: github.com/wvdlaan/sicp -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Macros to help writing closures?
Hello I am a beginner when it comes to writing macros, so there may be an easy way to do this. I have a number of 'state machines' which have this sort of appearance: (defn startFSM [eventQ] (let [state (atom :1) going (atom true) timerId (atom -1) startTimer (fn [] ) stopTimer (fn [] ...)] (inThread (while @going (let [ev (.take eventQ)] (condp = @state :1 () :2 (...) etc...)) where inThread runs its body in a thread, and the timer functions deal with timers. So, when (startFSM aQ) is called, the thread runs and processes events arriving on aQ. My question is, how to write a macro, fsmWithTimers, that could be used like this: (fsmWithTimers (condp = @state :1 () :2 (...) etc...)) which would resolve into the form shown above, so that the items mentioned in the outer let are usable (via the names specified) within the body (in the example a condp form)? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Macros to help writing closures?
On Sat, Apr 21, 2012 at 11:27 AM, timc wrote: > Hello > > I am a beginner when it comes to writing macros, so there may be an easy way > to do this. > I have a number of 'state machines' which have this sort of appearance: > > (defn startFSM [eventQ] > (let [state (atom :1) > going (atom true) > timerId (atom -1) > startTimer (fn [] ) > stopTimer (fn [] ...)] > (inThread > (while @going > (let [ev (.take eventQ)] > (condp = @state > :1 () > :2 (...) > etc...)) > > where inThread runs its body in a thread, and the timer functions deal with > timers. So, when (startFSM aQ) is called, the thread runs and processes > events arriving on aQ. > > My question is, how to write a macro, fsmWithTimers, that could be used like > this: > > (fsmWithTimers > (condp = @state > :1 () > :2 (...) > etc...)) > > which would resolve into the form shown above, so that the items mentioned > in the outer let are usable (via the names specified) within the body (in > the example a condp form)? (defmacro fsmWithTimers [& body] `(defn startFSM [eventQ#] (let [~'state (atom :1) ~'going (atom true) ~'timerId (atom -1) ~'startTimer (fn [] ) ~'stopTimer (fn [] ...)] (inThread (while (deref ~'going) (let [~'ev (.take eventQ#)] ~@body)) oughta do it. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Clojurescript and SQLite?
I would like to write an offline webapp for iphone using clojurescript and sqlite. Do you know some project/tutorial to take a look? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
ANN expectations-mode 0.0.2
Hey, I use the expectations testing framework a fair amount at work, so created an emacs minor mode for running the tests ala clojure-test-mode. It is based on clojure-test-mode so has many of the same keybindings: https://github.com/gar3thjon3s/expectations-mode/tree/0.0.2 I had to update expectations itself to add extra metadata onto its test vars, so it only works with >= v1.3.7 or expectations. I have pushed expectations-mode to the marmalade-repo or you can just put it on your load-path and require it. Hope somebody else finds it useful, Cheers, Gaz -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Newbie question about rebinding local variables
There is also a non-idiomatic way - transform your code to use a native Java data structure like ArrayList or primitive array. You may want it for the speed or if the mutable algorithm is more readable. Anyway isolation of the mutable code is always a good advice. (defn new-game [] (let [board (java.util.ArrayList. (repeat 9 nil))] (fn [n i] (cond (= n :x)(.set board i 'x) (= n :o)(.set board i 'o) (= n :print) (println board) -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Newbie question about rebinding local variables
Another non-standard solution you could try is to use the state monad from the monad library. On Apr 21, 2012 3:22 PM, "Sergey Didenko" wrote: > There is also a non-idiomatic way - transform your code to use a > native Java data structure like ArrayList or primitive array. > > You may want it for the speed or if the mutable algorithm is more > readable. Anyway isolation of the mutable code is always a good > advice. > > (defn new-game [] > > (let [board (java.util.ArrayList. (repeat 9 nil))] > >(fn [n i] > > (cond > >(= n :x)(.set board i 'x) > >(= n :o)(.set board i 'o) > >(= n :print) (println board) > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient with > your first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: a library I'm working on for generating PDFs from Clojure
On Sat, Apr 21, 2012 at 6:20 AM, David Jagoe wrote: > Can anybody tell me whether wkhtmltopdf or flying-saucer deal with > pagination properly? I've been templating TeX to get properly laid out > tables broken over multiple pages. But of course I'd much rather just > generate the PDFs from the HTML that I am already maintaining. Somewhat tangential, but why not generate HTML from TeX? > On 20 April 2012 19:40, Tim Robinson wrote: >> >> Also, wkhtmltopdf has worked well for me. >> >> http://code.google.com/p/wkhtmltopdf/ >> >> On Apr 20, 4:06 am, Patrick Wright wrote: >> > Dmitri, >> > >> > you might look at delegating some of the effort to Flying Saucer, which >> > can >> > generate PDFs when given clean HTML and >> > CSS.http://code.google.com/p/flying-saucer/ >> > >> > There is a blog somewhere (which is currently unreachable) of someone >> > using >> > FS from Clojure. >> > >> > HTH, >> > Patrick >> >> -- >> You received this message because you are subscribed to the Google >> Groups "Clojure" group. >> To post to this group, send email to clojure@googlegroups.com >> Note that posts from new members are moderated - please be patient with >> your first post. >> To unsubscribe from this group, send email to >> clojure+unsubscr...@googlegroups.com >> For more options, visit this group at >> http://groups.google.com/group/clojure?hl=en > > > > > -- > David Jagoe > > davidja...@gmail.com > +447535268218 > > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient with your > first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: PersistentHashMaps coming to ClojureScript
Excellent! Any idea how this implementation would compare performance wise to the java implementation if imported to Clojure? On Apr 20, 8:36 pm, Michał Marczyk wrote: > It's pure ClojureScript. Hopefully a step towards CinC, yes. :-) > > Sincerely, > Michał > > On 20 April 2012 20:32, Brent Millare wrote: > > > > > > > > > Quick question, so does this mean we have clojure's persistent data > > structures implemented in clojurescript or js? This would mean we are one > > more step closer to C-in-C right? > > > On Friday, April 20, 2012 1:38:17 PM UTC-4, Michał Marczyk wrote: > > >> Since the latest PHM patch has now been merged to master (thanks, > >> David!), I wanted to take this opportunity to note that porting all > >> that Java code (including the transient support for PHM -- a working > >> version of which is available for testing in its own ticket [1] -- and > >> now the PersistentTreeMap [2]) has been completely smooth sailing. > >> Some additions have been made to the implementation to improve > >> performance while maintaining clarity of the code (here some excellent > >> suggestions from David were very helpful), but the initial > >> implementation already worked without them and client code could > >> absolutely replicate them (by providing the requisite compiler macros > >> in its own namespace). It's not that I expected insurmountable > >> difficulties, but experiencing just how complete ClojureScript already > >> is in the context of this sort of non-trivial data structure > >> implementation task has been amazing. > > >> For those interested in how PHM's performance compares to that of the > >> previously used ObjMap and HashMap copy-on-write implementations, > >> there are some jsPerf tests linked to from the ticket [3]. There's > >> also a TransientHM vs. PHM comparison linked to from [2]. > > >> Sincerely, > >> Michał > > >> [1]http://dev.clojure.org/jira/browse/CLJS-181 > >> [2]http://dev.clojure.org/jira/browse/CLJS-187 > >> [3]http://dev.clojure.org/jira/browse/CLJS-178 > > > -- > > You received this message because you are subscribed to the Google > > Groups "Clojure" group. > > To post to this group, send email to clojure@googlegroups.com > > Note that posts from new members are moderated - please be patient with your > > first post. > > To unsubscribe from this group, send email to > > clojure+unsubscr...@googlegroups.com > > > For more options, visit this group at > >http://groups.google.com/group/clojure?hl=en -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Typed Clojure 0.1-alpha2
Looks interesting. Personally I always thought clojure's handling of function arity is a bit strange. I don't understand why calling a function like this (defn testfn [one two] ...) (test-fn 1) is not at least a compiler warning, possibly with a switch for the compiler for strict checking. I understand that it is not always possible to perform this check, but why not do it when possible? It would make clojure alot safer to use without a test suite covering every code path. On Apr 20, 8:50 pm, Ambrose Bonnaire-Sergeant wrote: > Hi, > > I know there are a few people interested in trying Typed Clojure, > so I've cut an early alpha release to give a taste. > > These are *very* early days, but looking through the readme will > give you some hints as to what works in this release. Don't > expect too much. > > https://github.com/frenchy64/typed-clojure > > Please give it a whirl, feedback welcome! > > Thanks, > Ambrose -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: PersistentHashMaps coming to ClojureScript
With some minor alterations it should be just as fast as the Java implementation. David On Fri, Apr 20, 2012 at 7:35 PM, Casper Clausen wrote: > Excellent! Any idea how this implementation would compare performance > wise to the java implementation if imported to Clojure? > > On Apr 20, 8:36 pm, Michał Marczyk wrote: > > It's pure ClojureScript. Hopefully a step towards CinC, yes. :-) > > > > Sincerely, > > Michał > > > > On 20 April 2012 20:32, Brent Millare wrote: > > > > > > > > > > > > > > > > > Quick question, so does this mean we have clojure's persistent data > > > structures implemented in clojurescript or js? This would mean we are > one > > > more step closer to C-in-C right? > > > > > On Friday, April 20, 2012 1:38:17 PM UTC-4, Michał Marczyk wrote: > > > > >> Since the latest PHM patch has now been merged to master (thanks, > > >> David!), I wanted to take this opportunity to note that porting all > > >> that Java code (including the transient support for PHM -- a working > > >> version of which is available for testing in its own ticket [1] -- and > > >> now the PersistentTreeMap [2]) has been completely smooth sailing. > > >> Some additions have been made to the implementation to improve > > >> performance while maintaining clarity of the code (here some excellent > > >> suggestions from David were very helpful), but the initial > > >> implementation already worked without them and client code could > > >> absolutely replicate them (by providing the requisite compiler macros > > >> in its own namespace). It's not that I expected insurmountable > > >> difficulties, but experiencing just how complete ClojureScript already > > >> is in the context of this sort of non-trivial data structure > > >> implementation task has been amazing. > > > > >> For those interested in how PHM's performance compares to that of the > > >> previously used ObjMap and HashMap copy-on-write implementations, > > >> there are some jsPerf tests linked to from the ticket [3]. There's > > >> also a TransientHM vs. PHM comparison linked to from [2]. > > > > >> Sincerely, > > >> Michał > > > > >> [1]http://dev.clojure.org/jira/browse/CLJS-181 > > >> [2]http://dev.clojure.org/jira/browse/CLJS-187 > > >> [3]http://dev.clojure.org/jira/browse/CLJS-178 > > > > > -- > > > You received this message because you are subscribed to the Google > > > Groups "Clojure" group. > > > To post to this group, send email to clojure@googlegroups.com > > > Note that posts from new members are moderated - please be patient > with your > > > first post. > > > To unsubscribe from this group, send email to > > > clojure+unsubscr...@googlegroups.com > > > > > For more options, visit this group at > > >http://groups.google.com/group/clojure?hl=en > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient with > your first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Treatment of nil/null in a statically typed Clojure
On Fri Apr 20 02:46 2012, Ambrose Bonnaire-Sergeant wrote: > I've been doing some thinking about the treatment of nil in a > statically typed version of Clojure. > > It occurs to me that nil is significantly different to Java's null > reference, which is almost a Bottom type. > > Java's null is a subtype of any reference type. Clojure's nil is just > nil, subtype to nothing except itself. > > To accomodate this, nil should be implicitly added to the result type > of any interaction with Java via interop. > > (Union syntax: (U x0 .. xn) is the union of types x0..nx) > > :- > > (Integer. 1) :- (U java.lang.Integer nil) > (.getClass 1) :- (U java.lang.Class nil) > (class 1) :- java.lang.Class > > So the equivalent type of java.lang.Object (in Java-land) is > (U java.lang.Object nil) (in Clojure-land). > > The exception to the implicit nil rule would be when a the result of > an interop expression is a primitive value. A Java primitive cannot be > null. > > (. Integer MAXVALUE) :- int > > Hopefully I expressed my thoughts clearly. Does this strategy seem > correct? Are there any other uses of null that I should be handling? I think what you have here makes a lot of sense. As noted elsewhere in the thread, constructors should never return a null reference: they either succeed or throw an exception. The problem with Java, of course, is that there is generally no way to find out if a given method will return null. There are some attempts at annotations to help indicate that a Java reference may not be null [1], but there is no standard in this respect. It would be nice to have Typed Clojure be able to recognise some of these, or at least have the ability to add hint that a certain call will not return null. I'll give your typed clojure a try. Sincerely, Daniel [1]: http://stackoverflow.com/questions/4963300/which-notnull-java-annotation-should-i-use signature.asc Description: Digital signature
Re: Typed Clojure 0.1-alpha2
user=> (defn a [x y] x) #'user/a user=> (a 1) java.lang.IllegalArgumentException: Wrong number of args passed to: user$a (NO_SOURCE_FILE:0) user=> (a 1 2) 1 user=> (a 1 2 3) java.lang.IllegalArgumentException: Wrong number of args passed to: user$a (NO_SOURCE_FILE:0) user=> user=> (defn b [x & ys] x) #'user/b user=> (b 1) 1 user=> (b 1 2) 1 user=> (b) java.lang.IllegalArgumentException: Wrong number of args passed to: user$b (NO_SOURCE_FILE:0) user=> Where's the missing arity validation you are referring to ? Luc > Looks interesting. > > Personally I always thought clojure's handling of function arity is a > bit strange. I don't understand why calling a function like this > > (defn testfn [one two] ...) > > (test-fn 1) > > is not at least a compiler warning, possibly with a switch for the > compiler for strict checking. I understand that it is not always > possible to perform this check, but why not do it when possible? It > would make clojure alot safer to use without a test suite covering > every code path. > > > On Apr 20, 8:50 pm, Ambrose Bonnaire-Sergeant > wrote: > > Hi, > > > > I know there are a few people interested in trying Typed Clojure, > > so I've cut an early alpha release to give a taste. > > > > These are *very* early days, but looking through the readme will > > give you some hints as to what works in this release. Don't > > expect too much. > > > > https://github.com/frenchy64/typed-clojure > > > > Please give it a whirl, feedback welcome! > > > > Thanks, > > Ambrose > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient with your > first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en > -- Softaddicts sent by ibisMail! -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Typed Clojure 0.1-alpha2
The ClojureScript compiler doesn't seem to do those kinds of checks, but the Clojure compiler does. On 21 April 2012 09:18, Casper Clausen wrote: > Looks interesting. > > Personally I always thought clojure's handling of function arity is a > bit strange. I don't understand why calling a function like this > > (defn testfn [one two] ...) > > (test-fn 1) > > is not at least a compiler warning, possibly with a switch for the > compiler for strict checking. I understand that it is not always > possible to perform this check, but why not do it when possible? It > would make clojure alot safer to use without a test suite covering > every code path. > > > On Apr 20, 8:50 pm, Ambrose Bonnaire-Sergeant > wrote: > > Hi, > > > > I know there are a few people interested in trying Typed Clojure, > > so I've cut an early alpha release to give a taste. > > > > These are *very* early days, but looking through the readme will > > give you some hints as to what works in this release. Don't > > expect too much. > > > > https://github.com/frenchy64/typed-clojure > > > > Please give it a whirl, feedback welcome! > > > > Thanks, > > Ambrose > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient with > your first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Typed Clojure 0.1-alpha2
I assumed he was talking about Clojure on the JVM... We came to a point where specifying the implementation is a requirement when posting on this list to prevent confusion :))) Luc > The ClojureScript compiler doesn't seem to do those kinds of checks, but > the Clojure compiler does. > > On 21 April 2012 09:18, Casper Clausen wrote: > > > Looks interesting. > > > > Personally I always thought clojure's handling of function arity is a > > bit strange. I don't understand why calling a function like this > > > > (defn testfn [one two] ...) > > > > (test-fn 1) > > > > is not at least a compiler warning, possibly with a switch for the > > compiler for strict checking. I understand that it is not always > > possible to perform this check, but why not do it when possible? It > > would make clojure alot safer to use without a test suite covering > > every code path. > > > > > > On Apr 20, 8:50 pm, Ambrose Bonnaire-Sergeant > > wrote: > > > Hi, > > > > > > I know there are a few people interested in trying Typed Clojure, > > > so I've cut an early alpha release to give a taste. > > > > > > These are *very* early days, but looking through the readme will > > > give you some hints as to what works in this release. Don't > > > expect too much. > > > > > > https://github.com/frenchy64/typed-clojure > > > > > > Please give it a whirl, feedback welcome! > > > > > > Thanks, > > > Ambrose > > > > -- > > You received this message because you are subscribed to the Google > > Groups "Clojure" group. > > To post to this group, send email to clojure@googlegroups.com > > Note that posts from new members are moderated - please be patient with > > your first post. > > To unsubscribe from this group, send email to > > clojure+unsubscr...@googlegroups.com > > For more options, visit this group at > > http://groups.google.com/group/clojure?hl=en > > > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient with your > first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en -- Softaddicts sent by ibisMail! -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: a library I'm working on for generating PDFs from Clojure
On 21 April 2012 12:20, David Jagoe wrote: > Hi all, > > Can anybody tell me whether wkhtmltopdf or flying-saucer deal with > pagination properly? I've been templating TeX to get properly laid out > tables broken over multiple pages. But of course I'd much rather just > generate the PDFs from the HTML that I am already maintaining. I don't know about flying-saucer, but in my experience, WebKit does not do pagination properly, unless something's changed recently. -- Michael Wood -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Typed Clojure 0.1-alpha2
He did say, compile-time error. These errors are at run-time - that is, the following is just as obviously bad, but generates no warning until bar is called: (defn foo [x] 1) (defn bar [y] (foo y 1)) ;; compiles fine (bar 5) ;; throws runtime exception On Apr 21, 5:14 pm, Softaddicts wrote: > > > user=> (defn a [x y] x) > #'user/a > user=> (a 1) > java.lang.IllegalArgumentException: Wrong number of args passed to: user$a > (NO_SOURCE_FILE:0) > user=> (a 1 2) > 1 > user=> (a 1 2 3) > java.lang.IllegalArgumentException: Wrong number of args passed to: user$a > (NO_SOURCE_FILE:0) > user=> > > user=> (defn b [x & ys] x) > #'user/b > user=> (b 1) > 1 > user=> (b 1 2) > 1 > user=> (b) > java.lang.IllegalArgumentException: Wrong number of args passed to: user$b > (NO_SOURCE_FILE:0) > user=> > > Where's the missing arity validation you are referring to ? > > Luc > > > > > > > > > > > Looks interesting. > > > Personally I always thought clojure's handling of function arity is a > > bit strange. I don't understand why calling a function like this > > > (defn testfn [one two] ...) > > > (test-fn 1) > > > is not at least a compiler warning, possibly with a switch for the > > compiler for strict checking. I understand that it is not always > > possible to perform this check, but why not do it when possible? It > > would make clojure alot safer to use without a test suite covering > > every code path. > > > On Apr 20, 8:50 pm, Ambrose Bonnaire-Sergeant > > wrote: > > > Hi, > > > > I know there are a few people interested in trying Typed Clojure, > > > so I've cut an early alpha release to give a taste. > > > > These are *very* early days, but looking through the readme will > > > give you some hints as to what works in this release. Don't > > > expect too much. > > > >https://github.com/frenchy64/typed-clojure > > > > Please give it a whirl, feedback welcome! > > > > Thanks, > > > Ambrose > > > -- > > You received this message because you are subscribed to the Google > > Groups "Clojure" group. > > To post to this group, send email to clojure@googlegroups.com > > Note that posts from new members are moderated - please be patient with > > your first post. > > To unsubscribe from this group, send email to > > clojure+unsubscr...@googlegroups.com > > For more options, visit this group at > >http://groups.google.com/group/clojure?hl=en > > -- > Softaddicts sent by ibisMail! -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Treatment of nil/null in a statically typed Clojure
On 20 April 2012 01:43, Alan Malloy wrote: > On Apr 19, 4:06 pm, James Reeves wrote: >> On 19 April 2012 19:46, Ambrose Bonnaire-Sergeant >> >> wrote: >> > I've been doing some thinking about the treatment of nil in a >> > statically typed version of Clojure. >> >> Statically typed in what way? Java's type system doesn't seem >> particularly suited to a functional programming language like Clojure. > > There's nothing about functional programming that precludes static > typing. I didn't say it did. I said **Java's** type system doesn't seem suited to a functional programming language. - James -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en