Re: Using read-string and macros together

2012-06-13 Thread Brian Mosley
Doesn't this produce something like: (fn [] (read-string "(println \"hello\")")) which would return the list '(println "hello")? On Wednesday, June 13, 2012 7:29:54 PM UTC-4, Rob Harrop wrote: > > Hi, > > I have a use case where I'd like to load small forms in String format from > a database

Re: Trying to understand variable capture

2012-01-09 Thread Brian Mosley
Macro expansion time is just before compile time. -- 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. T

Re: Need help to translate a simple java program into Clojure program

2012-01-09 Thread Brian Mosley
Oops. A possible solution might look something like that... -- 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 fir

Re: Need help to translate a simple java program into Clojure program

2012-01-09 Thread Brian Mosley
(defrecord Pos [name value] Object (toString [this] (str ""))) (def actions [(Pos. "IBM", -50) (Pos. "ACCOR", -30); (Pos. "IBM", -10); (Pos. "APPLE", -20); (Pos. "AIRFRANCE", -20)]) (def options [(Pos. "IBM", 55) (Pos. "ACCOR", 40

Re: Colliding hashes

2011-12-31 Thread Brian Mosley
String hashing uses the default java hashCode method which contains the vulnerability. user=> (= (hash "Ey") (hash "FZ")) true user=> (apply = (map hash ["EyEy" "FZEy" "EyFZ" "FZFZ"])) true -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to

Colliding hashes

2011-12-31 Thread Brian Mosley
Saw this in a scala mailing list thread: http://www.youtube.com/watch?v=R2Cq3CLI6H8 Should the clojure hash be fixed? -- 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

Re: -> vs ->> and names vs anonymous function

2011-11-02 Thread Brian Mosley
On Wed, Nov 2, 2011 at 6:12 AM, Dennis Haupt wrote: > so -> and ->> behave the same as long as my functions only take one > parameter? They do if you avoid inline function definitions. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this

Re: -> vs ->> and names vs anonymous function

2011-11-02 Thread Brian Mosley
On Wed, Nov 2, 2011 at 5:37 AM, Dennis Haupt wrote: > i stumbled over two odd things > 1) -> and ->> have the same source code. why is that? -> and ->> are macros that have similar purposes. "->" inserts the previous form as the first argument to the function, "->>" inserts it as the last. > 2)

Re: Clojure in Emacs Seemingly Impossible

2011-09-10 Thread Brian Mosley
This was quite helpful for me. http://technomancy.us/149 On Sat, Sep 10, 2011 at 1:29 PM, Curran wrote: > > Greetings, > > I would greatly appreciate any guidance on where to find a working and > complete set of instructions for how to set up Emacs with swank- > clojure. I am in Ubuntu. > > I hav