On Mon, Jul 23, 2012 at 6:11 PM, Joe Hughes <jwhughe...@gmail.com> wrote:
> Denis: > > Thanks for the link. Looks interesting. Between it and the Euler > Project, I should continue learning Clojure. > Euler is also great, but 4clojure is specifically oriented towards Clojure, and the creators of 4clojure really tried to provide a path to learning Clojure: * First the basics: how to write expressions, what is "Truthy", what is "Falsey". ... * Then the datastructures, lists, maps, ... * Then the essential functions (map, reduce, ...): You often even have to re-implement them * And more advanced programming challenges: graph traversal, .. * And the killer feature: You can follow people and compare your solutions to theirs, sometimes it's frustrating: when comparing your solution to Christophe Grands's (or other Clojure guru), on the other hand if you can find a "mate" to compete with, this is a very cool emulation. (For example me[denlab] and my friend [ardumont], in http://www.4clojure.com/users, I'm in the top 79, he is in the top 88, booh! :-) Have fun! Denis > > Regards, > Joe > > > On Monday, July 23, 2012 10:53:56 AM UTC-5, Denis Labaye wrote: >> >> Hi, >> >> On Mon, Jul 23, 2012 at 5:38 PM, Joe Hughes <jwhughe...@gmail.com> wrote: >> >>> All, >>> >>> I figured it out. Still trying to get Functional Programming ideas >>> in my head. >>> >> >> The macro defspel is not functional programming, it's dark Lisp's macro >> Voodoo. >> >> I would not advise starting Clojure with macros, you should start with >> something with a smoother learning curve like: http://www.4clojure.com/** >> . >> >> That said, I red "The Land Of Lisp" before learning Clojure, and it's a >> great book. >> Transposing Common LISP to Clojure may not be a good idea though. >> >> My advice would be: If you want to learn Common Lisp before Clojure it's >> a great idea (you will enjoy Clojure much more :), but take the time to >> learn the language. >> If you want to directly learn Clojure, then take a good book (Clojure >> Programming - 2012, Practial Clojure - 2010 or Joy Of Clojure - 2011) + >> some practical work like 4clojure.com. >> >> Cheers, >> >> Denis >> >> >>> >>> Regards, >>> Joe >>> >>> >>> On Friday, June 29, 2012 11:11:56 AM UTC-5, Joe Hughes wrote: >>>> >>>> All, >>>> >>>> I've been playing with Clojure and found this website, >>>> http://www.lisperati.****com/clojure-spels/casting.html<http://www.lisperati.com/clojure-spels/casting.html> >>>> ****. Typed the code into Clojure 1.4.0 and got the issue below. >>>> Here is the code in question. >>>> >>>> >>>> (defmacro defspel [& rest] `(defmacro ~@rest)) >>>> >>>> >>>> (defspel game-action [command subj obj place & args] >>>> `(defspel ~command [subject# object#] >>>> `(spel-print (cond (and (= location '~'~place) >>>> (= '~subject# '~'~subj) >>>> (= '~object# '~'~obj) >>>> (have? '~'~subj)) >>>> ~@'~args >>>> :else '(i cannot ~'~command like that -))))) >>>> >>>> (game-action weld chain bucket attic >>>> (cond (and (have? 'bucket) (def chain-welded true)) >>>> '(the chain is now securely welded to the bucket -) >>>> :else '(you do not have a bucket -))) >>>> >>>> >>>> When I do >>>> >>>> >>>> (weld chain bucket) >>>> >>>> >>>> instead of getting >>>> >>>> >>>> (you do not have a chain -) >>>> >>>> >>>> I get >>>> >>>> >>>> (i cannot weld like that -) >>>> >>>> >>>> From what I'm reading (defspel game-action..., something isn't correct >>>> and the result is the :else instead of the if. This was written using >>>> Clojure 1.1, so if anyone has a solution about why this works in 1.1 and >>>> not 1.4 I would like to hear it. >>>> >>>> >>>> TIA, >>>> Joe >>>> >>> -- >>> 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+unsubscribe@**googlegroups.com<clojure%2bunsubscr...@googlegroups.com> >>> For more options, visit this group at >>> http://groups.google.com/**group/clojure?hl=en<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