Re: [ANN][Book] Clojure Recipes published and for sale on Amazon

2015-10-25 Thread Julian
Thanks everyone. 

On Thursday, 22 October 2015 22:52:25 UTC+11, Torsten Uhlmann wrote:
>
> Congratulations, Julian!
>
> Leonardo Borges <leonardo...@gmail.com > schrieb am Do., 22. 
> Okt. 2015 um 13:10 Uhr:
>
>> Congratulations Julian! I'll share this around!
>>
>> On Thu, Oct 22, 2015 at 9:51 PM Julian <julian...@gmail.com > 
>> wrote:
>>
>>> My book Clojure Recipes just got published and is for sale on Amazon! 
>>> http://clojurerecipes.net/
>>>
>>> http://www.amazon.com/Clojure-Recipes-Developers-Library-Julian/dp/0321927737/
>>>
>>> I've been working on it for about 2.5 years - I hope you find it useful! 
>>> (Or even better - I hope you know a friend that might find it useful.) 
>>>
>>> A little context in the form of Q below. 
>>>
>>> Cheers
>>> Julian
>>>
>>> *Q*
>>> *Haven't we got enough Clojure books already?*
>>> I asked this of Stuart Sierra when he was in down under 2 years ago. He 
>>> responded "we have enough 'introduction to Clojure books' but there is room 
>>> for other types of books". 
>>>
>>> *Who is it for?*
>>> This is a book for people who 'learn by doing'. It's for that guy in the 
>>> office who is interested in Clojure, and wants to use it to hack on a 
>>> project this weekend. (The assumption is you're familiar with Lisp-style 
>>> parens, but not much more.)
>>>
>>> The book contains 'starter projects' for various use-cases of a 
>>> small-to-medium size - it will hold your hand enough to get you started, 
>>> and then free you up to take your project as you choose. Each one is 
>>> self-contained, and assumes little Clojure knowledge, and explains the code 
>>> as you go. 
>>>
>>> *What? Clojure Recipes? Isn't there already a Clojure book in this 
>>> format?*
>>> I signed the contract in December 2012 with Pearson. At that time there 
>>> wasn't a Clojure book in this genre. 
>>>
>>> Then Ryan Neufeld announced he was writing a Clojure book in 2013. I got 
>>> in touch with Ryan and Justin Gehtland about the situation. They were both 
>>> amazingly generous and supportive, and clarified they could see differences 
>>> in the books intended purpose and content. I caught up with Ryan last year 
>>> at the Clojure Conj and he was warm and encouraging. 
>>>
>>> I came away feeling really positive about the Clojure community. 
>>> Everyone wants to 'grow the pie' of involved people. 
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google
>>> Groups "Clojure" group.
>>> To post to this group, send email to clo...@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+u...@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 unsubscribe from this group and stop receiving emails from it, send 
>>> an email to clojure+u...@googlegroups.com .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> -- 
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clo...@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+u...@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 unsubscribe from this group and stop receiving emails from it, send an 
>> email to clojure+u...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ANN][Book] Clojure Recipes published and for sale on Amazon

2015-10-22 Thread Julian
My book Clojure Recipes just got published and is for sale on Amazon! 
http://clojurerecipes.net/
http://www.amazon.com/Clojure-Recipes-Developers-Library-Julian/dp/0321927737/

I've been working on it for about 2.5 years - I hope you find it useful! 
(Or even better - I hope you know a friend that might find it useful.) 

A little context in the form of Q below. 

Cheers
Julian

*Q*
*Haven't we got enough Clojure books already?*
I asked this of Stuart Sierra when he was in down under 2 years ago. He 
responded "we have enough 'introduction to Clojure books' but there is room 
for other types of books". 

*Who is it for?*
This is a book for people who 'learn by doing'. It's for that guy in the 
office who is interested in Clojure, and wants to use it to hack on a 
project this weekend. (The assumption is you're familiar with Lisp-style 
parens, but not much more.)

The book contains 'starter projects' for various use-cases of a 
small-to-medium size - it will hold your hand enough to get you started, 
and then free you up to take your project as you choose. Each one is 
self-contained, and assumes little Clojure knowledge, and explains the code 
as you go. 

*What? Clojure Recipes? Isn't there already a Clojure book in this format?*
I signed the contract in December 2012 with Pearson. At that time there 
wasn't a Clojure book in this genre. 

Then Ryan Neufeld announced he was writing a Clojure book in 2013. I got in 
touch with Ryan and Justin Gehtland about the situation. They were both 
amazingly generous and supportive, and clarified they could see differences 
in the books intended purpose and content. I caught up with Ryan last year 
at the Clojure Conj and he was warm and encouraging. 

I came away feeling really positive about the Clojure community. Everyone 
wants to 'grow the pie' of involved people. 

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: sort-by reverse order?

2014-12-23 Thread Julian Jelfs
That's awesome! (though I'm slightly surprised there isn't an easier way). 

Thanks. 

On Tuesday, 23 November 2010 21:03:37 UTC, Tyler Perkins wrote:

 Nice! And with just a bit more, we have a clean, sorting DSL: 

 (def asc compare) 
 (def desc #(compare %2 %1)) 
 ;;  compare-by generates a Comparator: 
 (defn compare-by [ key-cmp-pairs] 
   (fn [x y] 
   (loop [[k cmp  more] key-cmp-pairs] 
  (let [result (cmp (k x) (k y))] 
   (if (and (zero? result) more) 
   (recur more) 
   result) 

 (sort (compare-by :last-name asc, :date-of-birth desc) coll)

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN] async-sockets - work with sockets using core.async channels

2014-10-11 Thread Julian
Hi Zach, 

Thanks for the clarity of thought that went into this post. 

Perhaps it is obvious to everyone but me, but I saw this post by Christophe 
Grande yesterday that appears to address these concerns:
Back-pressurized interop for 
core.async https://twitter.com/cgrand/status/520566182194450432
https://gist.github.com/cgrand/767673242b7f7c27f35a

I'm interested to hear if this solves your problem or is about something 
else. 

Cheers
Julian

On Wednesday, 8 October 2014 17:00:02 UTC+11, Zach Tellman wrote:

 The reason the thread-per-connection approach is nice is because it 
 correctly propagates backpressure.  If we're copying data from a source to 
 a sink (let's say reading it in from the network and writing to a file), 
 it's possible that the production of data may outstrip the consumption.  If 
 this happens, we need to make sure the producer slows down, or we risk 
 running out of memory.  In Java, the producer is typically connected to the 
 consumer via a blocking queue, and if the queue fills up the producer can't 
 send anything more to the consumer.  A Java socket is one such queue, and 
 if it fills up it will exert backpressure via TCP.  This will work no 
 matter how many queues or other mechanisms separate the producer and 
 consumer.

 However, every attempt I've seen to marry core.async to an async network 
 stack has been fundamentally broken, in that it doesn't do this.  Often, 
 they'll just use 'put!', which works fine until the channel's queue fills 
 up, and 1024 pending puts are accumulated, and finally the channel throws 
 an exception.  Alternately, they'll use a blocking put on the channel, 
 which means that any backpressure will also extend to whatever other 
 connections are sharing that thread or the thread pool.  Note that the 
 software that uses core.async in this way may work flawlessly in a wide 
 variety of cases, but there's still an intractable failure mode lying in 
 wait.

 In some cases, such as http-kit's websocket mechanism, there's no way to 
 even exert backpressure (you register a callback, and have no way to 
 indicate in your callback that you can't handle more messages).  This means 
 that any attempt to use http-kit in conjunction with core.async will be 
 subtly but fundamentally broken.  Arguably, even without core.async in the 
 equation it's broken.  This is not a good state of affairs.  I'll admit 
 that it took me a few failures in production to realize how important 
 correct handling of backpressure is, but this isn't something that our 
 ecosystem can afford to ignore, especially as Clojure is used for 
 larger-scale projects.

 I will note that I am working on a solution to this, in the form of the 
 upcoming Aleph release [1].  This will model every network connection via 
 streams that can trivially be converted into core.async channels [2], and 
 which exert backpressure over TCP wherever necessary without requiring a 
 thread per connection.  A formal beta should be available in the near 
 future (it's already handling billions of requests a day in production 
 without issue).

 Zach

 [1] https://github.com/ztellman/aleph/tree/0.4.0
 [2] https://github.com/ztellman/manifold



 On Tuesday, October 7, 2014 1:36:16 PM UTC-7, adrian...@mail.yu.edu wrote:

 It's not about 'safety' (depending on what that means in this context), 
 but as Zach pointed out, if you aren't careful about backpressure you can 
 run into performance bottlenecks with unrestrained async IO operations 
 because although they let you code as if you could handle an unlimited 
 amount of connections, obviously that isn't true. There is only a finite 
 amount of data that can be buffered in and out of any network according to 
 its hardware. When you don't regulate that, your system will end up 
 spending an inordinate amount of time compensating for this. You don't need 
 to worry about this with regular io because the thread per connection 
 abstraction effectively bounds your activity within the acceptable physical 
 constraints of the server. 

 On Tuesday, October 7, 2014 2:49:30 PM UTC-4, Brian Guthrie wrote:


 On Mon, Oct 6, 2014 at 12:10 AM, adrian...@mail.yu.edu wrote:

 Zach makes an excellent point; I've used AsyncSocketChannels and its 
 irk (
 http://docs.oracle.com/javase/8/docs/api/java/nio/channels/AsynchronousServerSocketChannel.html),
  
 with core.async in the past. Perhaps replacing your direct 
 java.net.Sockets 
 with nio classes that can be given CompletionHandlers (
 http://docs.oracle.com/javase/7/docs/api/java/nio/channels/CompletionHandler.html)
  
 would be a better fit. 


 Once I do some performance instrumentation I'll give that a shot. I 
 admit that I'm not familiar with all the implications of using the nio 
 classes; were I to switch, is it safe to continue using go blocks, or is it 
 worth explicitly allocating a single thread per socket?

 Brian



-- 
You received this message because you are subscribed to the Google
Groups

in Clojure I rarely find myself reaching for something like the state monad, as I would in Haskell

2014-05-16 Thread Julian
A quick shoutout to the Clojure Community - thanks for the way you've all 
contributed to make my life (mentally) richer. 

James Reeves (author of Compojure and many other wonderful libraries) made 
this interesting comment on Hacker News:
 Clojure has libraries that implement monads, but these aren't often used 
for threading state. I can't quite place my finger on why, but in Clojure I 
rarely find myself reaching for something like the state monad, as I would 
in Haskell.

Clojure tends to view mutability as a concurrency problem, and the tools 
it provides to deal with mutability, such as atoms, refs, agents, channels 
and so forth, are not mechanisms to avoid mutation, as to provide various 
guarantees that restrict it in some fashion.

It might be that in the cases where I'd use a state monad in Haskell, in 
Clojure I might instead use an atom. They're in no way equivalent, but they 
have some overlapping use-cases.

https://news.ycombinator.com/item?id=7751424

My question is - have other Clojure/Haskell programmers had this 
experience? (ie I rarely find myself reaching for something like the state 
monad). I'm interested to hear if so, and why. 

JG

PS If this post is unhelpful, could be worded better - please let me know. 
I'm asking out of curiosity, not with intent to troll. 

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


My Clojure Workflow, Reloaded

2013-06-05 Thread Julian
Stuart Sierra has written a fantastic article on his particular pattern for 
writing and testing Clojure code:
http://thinkrelevance.com/blog/2013/06/04/clojure-workflow-reloaded

There is some commentary on Hacker News about it here:
https://news.ycombinator.com/item?id=5819487

I'll include some of the salient points

Therefore, after every significant code change, I want to restart the 
application from scratch. But I don't want to restart the JVM and reload 
all my Clojure code in order to do it: that takes too long and is too 
disruptive to my workflow. Instead, I want to design my application in such 
a way that I can quickly shut it down, discard any transient state it might 
have built up, start it again, and return to a similar state. And when I 
say quickly, I mean that the whole process should take less than a second.


To achieve this goal, I make the application itself into a transient 
object. Instead of the application being a singleton tied to a JVM process, 
I write code to construct instances of my application, possibly many of 
them within one JVM. Each time I make a change, I discard the old instance 
and construct a new one. The technique is similar to dealing with virtual 
machines in a cloud environment: rather than try to transition a VM from an 
old state to a new state, we simply discard the old one and spin up a new 
one.


My questions to the fantastic hacker new communities are:
(1) Have you used this technique on your project?
(2) What is your experiences using this technique?
(3) Stuart hints that particular projects have to be structured to be able 
to better use this technique - can you point to a particular project that 
is well suited to this?


 

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: asm-based clojure yet?

2013-05-22 Thread Julian
One more thought on the broader ideas of LISPy languages and ASM. One of 
the versions of Crash Bandicoot was developed in Game Oriented Assembly 
LISP (GOAL) - which was a common LISP DSL that generated assembler. 

I recalled this today because Michael Fogus tweeted about it:
https://twitter.com/fogus/status/336865798628966400

If you're a hobbyist dabbling in this space then you might find reading 
about it interesting and inspiring:
http://en.wikipedia.org/wiki/Game_Oriented_Assembly_Lisp
http://all-things-andy-gavin.com/2011/03/12/making-crash-bandicoot-gool-part-9/

JG

On Sunday, 19 May 2013 01:49:43 UTC+10, Gary Trakhman wrote:

 It's hard to really appreciate java and clojure until you actually write 
 some C/C++ or ASM.. I have some minor experience with that stuff, and it 
 still haunts me from time to time. 

 Sometimes we make tradeoffs without knowing we did.  By choosing a 
 language, or having the choice made for us, we accept a set of abstractions 
 as our bottom level of thinking for a problem-space.  Only old-timers and 
 people that make a point to care about low-level stuff will notice the 
 implications of what they're doing along the abstraction stack.  People 
 with ingrained habits just won't find it easy to think functionally, but 
 I'm young and irreverent, so it doesn't bother me :-).

 C++ is fun because of all the bolted-on kludges that 'mitigate' these 
 problems.  You can use operator-overloading on pointer operations to 
 perform automatic reference counting, deallocating objects when things that 
 point to them go out of scope, but I think implementing a PersistentHashMap 
 this way would be very difficult.  Also, pretty sure it can't handle cycles.

 I guess the point is, I appreciate any effort to understand such issues, 
 it's been a useful thing for me to know in the 0.05% of time that knowledge 
 is needed.

 But, people who don't know just won't be able to get past those problems. 
  And, you generally can't easily find a _really_ full-stack guy to glance 
 at it for you when it would be useful to have one.

 On Sat, May 18, 2013 at 11:24 AM, atkaaz atk...@gmail.com 
 javascript:wrote:

 your comment caused me to be reading this 
 http://prog21.dadgum.com/134.html
   (at least)


 On Sat, May 18, 2013 at 6:17 PM, Gary Trakhman 
 gary.t...@gmail.comjavascript:
  wrote:

 Immutability, persistence, closures without a serious garbage collector 
 sounds hard.


 On Sat, May 18, 2013 at 1:09 AM, atkaaz atk...@gmail.com 
 javascript:wrote:

 Thanks very much everyone! I'm looking into all of those, but currently 
 planning to read Julian's pdf. I didn't want to say anything until I had 
 something definite, but just letting y'all know that I'm considering each 
 recommendation.


 On Sat, May 18, 2013 at 7:12 AM, Julian julian...@gmail.comjavascript:
  wrote:

 If you had a hobbyist interest in representing S-expressions in 
 assembler - then you could take a look at the tutorial written by 
 Abdulaziz 
 Ghuloum called Compilers: Backend to Frontend and Back to Front Again. 
 It 
 used to be available here: 
 http://www.cs.indiana.edu/~aghuloum/compilers-tutorial-2006-09-16.pdf

 I don't know if it available anywhere else on the internet - but I 
 grabbed another copy and put it here: 
 https://sites.google.com/site/juliangamble/Home/Compilers%20Tutorial%202006-09-16.pdf?attredirects=0d=1

 For a more serious representation of Clojure's persistent data 
 structures, I don't recommend trying to implement them in ASM. 

 Cheers
 Julian


 On Friday, 17 May 2013 22:06:45 UTC+10, Alan D. Salewski wrote:

 On Fri, May 17, 2013 at 02:10:02PM +0300, atkaaz spake thus: 
  Ok, weird question: is there some clojure port on assembler yet? 
 Even 
  if(/especially if) it doesn't have jvm/java/javalibs support 
  
  Or should I just check 
  https://github.com/clojure/**clojure-clrhttps://github.com/clojure/clojure-clr?
   
  
  I'm mainly interested in low memory footprint and fast startup 
 times (does 
  clojure-clr have that?) 

 You may want to check out ClojureScript, too. ClojureScript programs 
 leveraging nodejs for host interop have fast startup times: 

 
 https://github.com/clojure/**clojurescript/wikihttps://github.com/clojure/clojurescript/wiki
  

 -- 
 --**--**- 

 a l a n   d.   s a l e w s k i   sale...@att.net 
 1024D/FA2C3588 EDFA 195F EDF1 0933 1002  6396 7C92 5CB3 FA2C 3588 
 --**--**- 


  -- 
 -- 
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clo...@googlegroups.comjavascript:
 Note that posts from new members are moderated - please be patient 
 with your first post.
 To unsubscribe from this group, send email to
 clojure+u...@googlegroups.com javascript:
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en

Re: asm-based clojure yet?

2013-05-17 Thread Julian
If you had a hobbyist interest in representing S-expressions in assembler - 
then you could take a look at the tutorial written by Abdulaziz Ghuloum 
called Compilers: Backend to Frontend and Back to Front Again. It used to 
be available 
here: http://www.cs.indiana.edu/~aghuloum/compilers-tutorial-2006-09-16.pdf

I don't know if it available anywhere else on the internet - but I grabbed 
another copy and put it 
here: 
https://sites.google.com/site/juliangamble/Home/Compilers%20Tutorial%202006-09-16.pdf?attredirects=0d=1

For a more serious representation of Clojure's persistent data structures, 
I don't recommend trying to implement them in ASM. 

Cheers
Julian

On Friday, 17 May 2013 22:06:45 UTC+10, Alan D. Salewski wrote:

 On Fri, May 17, 2013 at 02:10:02PM +0300, atkaaz spake thus: 
  Ok, weird question: is there some clojure port on assembler yet? Even 
  if(/especially if) it doesn't have jvm/java/javalibs support 
  
  Or should I just check https://github.com/clojure/clojure-clr ? 
  
  I'm mainly interested in low memory footprint and fast startup times 
 (does 
  clojure-clr have that?) 

 You may want to check out ClojureScript, too. ClojureScript programs 
 leveraging nodejs for host interop have fast startup times: 

 https://github.com/clojure/clojurescript/wiki 

 -- 
 - 
 a l a n   d.   s a l e w s k i   sale...@att.netjavascript: 
 1024D/FA2C3588 EDFA 195F EDF1 0933 1002  6396 7C92 5CB3 FA2C 3588 
 - 


-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: How to speed up Clojure Training for New Recruitment

2012-06-20 Thread Julian
Thanks Jay, 

Those articles are indeed inspirational. I was just wondering - back from 
your TW days - would the arguments in those articles make sense for a TW 
consultant to present to a client?

Cheers, Julian

On Tuesday, 19 June 2012 01:22:34 UTC+10, Jay Fields wrote:


 learning curve, and training time be reduced for new recruits ? Also how 
 do you pitch it to the management ? 
  
 I'd read this for inspiration on how to talk to mgmt. Perhaps I'd even 
 suggest they read it. http://www.paulgraham.com/avg.html 
 Related: http://www.paulgraham.com/icad.html

 Cheers, Jay


-- 
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: algebra system core.logic

2012-05-20 Thread Julian
Core.logic isn't the only way to approach this problem. In Peter Norvig's 
PAIP he included a simple algebra system, macsyma 
http://norvig.com/paip/macsyma.lisp (in common lisp). 

JG

On Sunday, 20 May 2012 06:21:56 UTC+10, Brent Millare wrote:

 That's more or less what I'm going to have to do anyways. It's great that 
 clojure + core.logic make that as easy as possible.

 On Friday, May 18, 2012 10:42:16 PM UTC-4, David Nolen wrote: 

 It might also be interesting to pursue a hybrid system - that's the whole 
 point of core.logic - being able to mix functional and relational 
 programming with minimal hassle.

 David




-- 
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: Rich Hickey Video - unit conversion language

2012-03-06 Thread Julian
Awesome - I wonder if Frinj was what Rich had in mind when he was giving 
that talk?

On Sunday, 4 March 2012 19:08:36 UTC+11, martintrojer wrote:

 And now there is Frinj! :)

 https://github.com/martintrojer/frinj

 On Monday, 21 June 2010 12:46:55 UTC+1, Julian wrote:

 Rich Hickey made reference in one of his videos to a language that 
 could convert between all different kinds of units and dimensions. 
 Does anybody recall what that was?



-- 
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

clj-blueprints

2012-02-24 Thread Eduardo Julian
I'd like to present you with an small library for working with
Blueprints-enabled graph databases in Clojure:
https://github.com/eduardoejp/clj-blueprints

Have fun!

-- 
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: Debugging Java heap space memory error with lazy sequences.

2011-11-18 Thread Julian Kelsey
Thanks!

To confirm my understanding: in my original version I defined (using def) a
reference to a lazy sequence. I then evaluated it, using nth to pick a
value from the sequence. Because I have a reference to the beginning of the
sequence all the lazily generated items are retained. I.e. the lazy
sequence is lazy only for the first time it works through the sequence
instance, if there is a live reference to the sequence then those now
generated elements remain, (to avoid the overhead of regenerating them?).

By providing a function to return a new instance of the sequence each time,
as in the solution Meikel has provided, I avoid retaining any references to
the front of the sequence, and the garbage collector can do it's work.

I always learn much better by making mistakes like these.


Cheers,
Julian.

On Thu, Nov 17, 2011 at 9:49 PM, Meikel Brandmeyer m...@kotka.de wrote:

 Hi,

 this is a “hold unto head” problem.

 Am 17.11.2011 um 15:06 schrieb Julian Kelsey:

(def seq-3s-n-5s
  (filter
(fn [n] (or (= 0 (mod n 5)) (= 0 (mod n 3)) ) )
(iterate inc 1)))

 Here you keep a reference to the head of the generated by iterate. Make it
 a function:

 (defn seq-3s-n-5s
  []
  (filter #(or (zero? (mod % 5)) (zero? (mod % 3))) (iterate inc 1)))

 Then call it like this:

 (nth (sums (seq-3s-n-5s 0) (Math/pow 10 6))

 That should fix your problem.

 Sincerely
 Meikel

 --
 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

Debugging Java heap space memory error with lazy sequences.

2011-11-17 Thread Julian Kelsey
I was working on a few of the Project Euler puzzles. The first involves
picking the nth element from a particular series, (sum the numbers factored
either by 3 or 5 below 1000). One forum comment on the very first puzzle
raised the criticism that it's easy to solve the question as presented
(i.e. below 1000), but what if you wanted the sum below 10^18?

I started working towards the big number goal using lazy sequences.

First, a lazy sequence of numbers that are factored by 3 or 5. Second,
another lazy sequence such that the nth element is the sum of the first n
elements of the input sequence. Finally, pick the nth element, (it doesn't
quite match the question, but it's of similar complexity):

  (def seq-3s-n-5s
(filter
  (fn [n] (or (= 0 (mod n 5)) (= 0 (mod n 3)) ) )
  (iterate inc 1)))

  (defn sums [coll n]
(lazy-seq
  (when-let [s (seq coll)]
(let [x (+ n (first s))]
  (cons x (sums (rest s) x))

  (nth (sums seq-3s-n-5s 0) (Math/pow 10 6))

However some where between (Math/pow 10 6) and (Math/pow 10 7) It throws an
error: java.lang.OutOfMemoryError: Java heap space. I'm wondering if I'm
crossing some threshold into a different number type? Or perhaps I've
missed some point and got the lazy sequence stuff wrong?

So my question has two parts:
(1) How can I fix this code so that it will run to further into the
sequence?
(2) What actually has gone wrong? How could you debug something like this?

Notes: we can trust that (nth seq N) is not the problem, it returns in
reasonable time for a test like this: (nth (iterate inc 1) (Math/pow 10 9))


Cheers,
Julian Kelsey.

-- 
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: Homoiconicity in clojure (macro power)

2011-11-01 Thread Julian
There are some examples of homoiconicity in other languages here:
http://c2.com/cgi/wiki?HomoiconicExampleInManyProgrammingLanguages
(being TCL, Joy and Io)
 
Also worth noting is the recent work by Ola Bini on Ioke. 

Another interesting homoiconic language was Apple's Dylan language - which 
transitioned from leading parentheses and prefix expressions (both 
S-Expressions) to  infix expressions and a more C-like syntax:
http://en.wikipedia.org/wiki/History_of_the_Dylan_programming_language#The_roots_of_changing_the_syntax_from_lisp_way_to_an_infix_one
 
I wonder what would be required for a modification to the clojure reader in 
order to do this...

-- 
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: Homoiconicity in clojure (macro power)

2011-11-01 Thread Julian
Julian julian...@gmail.com writes: 

 I wonder what would be required for a modification to the clojure reader 
in
 order to do this... 

No intention of picking on Julian, but do we really have to re-live all
of the flamewars and jawflapping of comp.lang.lisp on the clojure group
again?  You're giving me flashbacks 8^) 

My apologies, my intention was to provide a thinking scenario, rather than 
troll for a flamewar. If that's the probable outcome then let's drop it, 
and make a mature decision to focus on something else. 

Cheers to the Clojure community. 

JG 

 

-- 
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

Clojure binding for OrientDB

2011-08-01 Thread Eduardo Julian
I have been working on this library for a little while and I would
like to present it to you:
https://github.com/eduardoejp/clj-orient

I hope this can be of help for the Clojure and OrientDB communities.

-- 
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: [Clojurescript] Any of this in the pipeline?

2011-07-26 Thread Julian
 These were the four major features which first got me interested in GWT: 
* tooling in GWT - being able to debug compiled javascript step by step 
whilst working in an eclipse java debugger is what stood out for me (and 
seemed to help it scale to large applications)
 
I've got stacks of respect for Rich Hickey and the work his team has put 
into this - and the community that has sprung up around Clojure. My question 
is intended to be about opportunities and next steps for the community.  My 
question is this: 
What are the missing 'pieces of the puzzle' - that would allow this kind of 
GWT-style, IDE-integrated debugging of large scale apps in ClojureScript? 
(I'm aware debugging and stack traces could be better in Clojure generally - 
I was asking about the other hooks and components.)

-- 
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 stupid jvm question

2011-06-24 Thread Eduardo Julian
You might want to check this out:
https://github.com/tinkerpop/tinkubator/tree/master/mutant

-- 
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


clj-ripple

2011-05-11 Thread Eduardo Julian
I made a little library called clj-ripple for the easy embedding of
Ripple code (for navigating the Semantic Web) inside Clojure programs.

It works by translating Clojure sexps to Ripple code strings through a
macro and then executes and returns the resulting stacks as lazy
sequences.

The git repo can be found here: https://github.com/eduardoejp/clj-ripple

To include it in your projects, add this to your leiningen deps: [clj-
ripple 0.1.0-SNAPSHOT]

For more info about the Ripple scripting language, please visit the
following links:
* http://ripple.fortytwo.net/
* http://ripple.googlecode.com/svn/trunk/docs/screencast/index.html
* https://github.com/joshsh/ripple/wiki

Happy crawling!

-- 
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: Cyber Dungeon Quest Alpha 1

2011-04-15 Thread Julian
I looked at this and thought,  It reminds me of Wyvern.

The lead developer behind Wyvern, Steve Yegge, was a fairly visionary
and expressive programmer who has written a lot about LISP and JVM
related subjects.

I was reminded of Steve Yegge's post on when he thought he'd rewrite
Wyvern to reduce the number of lines of code, and decided the best way
to do it would be to use LISP, but ended up settling on Mozilla Rhino
(javascript/ecmascript).

http://steve-yegge.blogspot.com/2007/12/codes-worst-enemy.html

It feels like lots of Steve's visionary posts are making an appearance
in the amazing Clojure community.

JG

On Apr 14, 10:03 pm, Wei Hsu yayits...@gmail.com wrote:
 Very cool! I really enjoyed playing it.

 On Apr 14, 12:20 pm, Alan a...@malloys.org wrote:







  Similar error for me, on Ubuntu. Exception and wrapped exception
  follow. Looks like you may need permissions set better? 403 is
  Forbidden.

  com.sun.deploy.net.FailedDownloadException: Unable to load 
  resource:http://sappler.ls4.allbytes.de/resatori/webstart/cdq.jnlp
          at
  com.sun.deploy.net.DownloadEngine.actionDownload(DownloadEngine.java:
  1372)
          at
  com.sun.deploy.net.DownloadEngine.getCacheEntry(DownloadEngine.java:
  1525)
          at
  com.sun.deploy.net.DownloadEngine.getCacheEntry(DownloadEngine.java:
  1503)
          at
  com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(DownloadEngine.java 
  :
  1609)
          at
  com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(DownloadEngine.java 
  :
  1534)
          at 
  com.sun.deploy.net.DownloadEngine.getResource(DownloadEngine.java:
  217)
          at 
  com.sun.deploy.net.DownloadEngine.getResource(DownloadEngine.java:
  201)
          at com.sun.javaws.Launcher.updateFinalLaunchDesc(Launcher.java:469)
          at com.sun.javaws.Launcher.prepareToLaunch(Launcher.java:248)
          at com.sun.javaws.Launcher.prepareToLaunch(Launcher.java:199)
          at com.sun.javaws.Launcher.launch(Launcher.java:116)
          at com.sun.javaws.Main.launchApp(Main.java:416)
          at com.sun.javaws.Main.continueInSecureThread(Main.java:248)
          at com.sun.javaws.Main$1.run(Main.java:110)
          at java.lang.Thread.run(Thread.java:662)

  java.io.IOException: Server returned HTTP response code: 403 for 
  URL:http://sappler.ls4.allbytes.de/resatori/webstart/cdq.jnlp
          at sun.reflect.GeneratedConstructorAccessor1.newInstance(Unknown
  Source)
          at
  sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstru 
  ctorAccessorImpl.java:
  27)
          at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
          at sun.net.www.protocol.http.HttpURLConnection
  $6.run(HttpURLConnection.java:1491)
          at java.security.AccessController.doPrivileged(Native Method)
          at
  sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnec...
  1485)
          at
  sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection
  1139)
          at
  com.sun.deploy.net.BasicHttpRequest.doRequest(BasicHttpRequest.java:
  229)
          at
  com.sun.deploy.net.BasicHttpRequest.doRequest(BasicHttpRequest.java:
  113)
          at
  com.sun.deploy.net.BasicHttpRequest.doGetRequest(BasicHttpRequest.java:
  78)
          at
  com.sun.deploy.net.DownloadEngine.actionDownload(DownloadEngine.java:
  1182)
          at
  com.sun.deploy.net.DownloadEngine.getCacheEntry(DownloadEngine.java:
  1525)
          at
  com.sun.deploy.net.DownloadEngine.getCacheEntry(DownloadEngine.java:
  1503)
          at
  com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(DownloadEngine.java 
  :
  1609)
          at
  com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(DownloadEngine.java 
  :
  1534)
          at 
  com.sun.deploy.net.DownloadEngine.getResource(DownloadEngine.java:
  217)
          at 
  com.sun.deploy.net.DownloadEngine.getResource(DownloadEngine.java:
  201)
          at com.sun.javaws.Launcher.updateFinalLaunchDesc(Launcher.java:469)
          at com.sun.javaws.Launcher.prepareToLaunch(Launcher.java:248)
          at com.sun.javaws.Launcher.prepareToLaunch(Launcher.java:199)
          at com.sun.javaws.Launcher.launch(Launcher.java:116)
          at com.sun.javaws.Main.launchApp(Main.java:416)
          at com.sun.javaws.Main.continueInSecureThread(Main.java:248)
          at com.sun.javaws.Main$1.run(Main.java:110)
          at java.lang.Thread.run(Thread.java:662)
  Caused by: java.io.IOException: Server returned HTTP response code:
  403 for URL:http://sappler.ls4.allbytes.de/resatori/webstart/cdq.jnlp
          at
  sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection
  1436)
          at 
  java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:
  379)
          at
  com.sun.deploy.net.BasicHttpRequest.doRequest(BasicHttpRequest.java:
  190)
          ... 17 more

  On Apr 14, 12:03 pm, mark skilbeck 

VerifyError trouble

2011-01-28 Thread Eduardo Julian
Hi guys.

I was working on a macro for easily defining mutable classes without
having to previously define a protocol for the methods in them (the
macro takes care of that for you) and providing basic get-set
operations.

However, I have trouble when defining classes, cause I get the
following error:
java.lang.VerifyError: (class: x/y/Z, method: clinit signature: ()V)
Incompatible argument to function

You can check out the code here: https://gist.github.com/800813

I'm using Clojure 1.2 on this one.

Am I doing something wrong or is this a bug in Clojure?

I think the problem comes when I add the metadata to the variables in
the class.

BTW: The switch macro that appears there is my version of 'case' and
it works mostly the same.

-- 
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: VerifyError trouble

2011-01-28 Thread Eduardo Julian
I think I have the same error as in this post:
http://groups.google.com/group/clojure/browse_thread/thread/8257e4ec8a652b23/e94df8077ecb1ac4

-- 
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


Why is DISsoc being DIScriminated?

2011-01-13 Thread Eduardo Julian
I noticed that although you can use assoc with sequences and vectors
to modify them, you could not use dissoc to eliminate elements from
them. Why is this so?

-- 
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


OrientDB

2010-11-30 Thread Eduardo Julian
Hey guys,

I know it's not directly related to Clojure, but I'm in a start-up
with some friends and I'll be working on a website that would
seriously benefit from graph DBs. I've checked out Neo4J (and found it
quite nice), but OrientDB also seems really cool and it sports a more
flexible license (plus it seems to be better when it comes to
scalability).

However, there ain't much info about it outside the company's website.

Has anyone of you ever used it? If so, what has been your experience
with it?

P.S: In case I choose to use it, you can count on me open-sourcing a
Clojure lib for it, :P

-- 
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


Symbol evaluation error in let

2010-11-27 Thread Eduardo Julian
user= (let [a 'b] (str a))
b
user= (let [b 5 a 'b] (eval a))
java.lang.Exception: Unable to resolve symbol: b in this context
(repl-1:7)
user= (let [a 'b b 5] (eval a))
java.lang.Exception: Unable to resolve symbol: b in this context
(repl-1:9)

user= (def b 5)
#'user/b
user= (def a 'b)
#'user/a
user= a
b
userr= (eval a)
5

How come this problem happens inside the let but not with def?

-- 
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: Symbol evaluation error in let

2010-11-27 Thread Eduardo Julian
Woah. That's as weird as you can get.

Thanks, man.

-- 
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


Can clojure.contrib.fnmap.PersistentFnMap have metadata

2010-11-27 Thread Eduardo Julian
I was trying to use the fnmap API at clojure.contrib for some things
and I needed to add metadata to the function maps but I got this
exception:
java.lang.ClassCastException: clojure.contrib.fnmap.PersistentFnMap
cannot be cast to clojure.lang.IObj

Stuart, can you make PersistentFnMa extend IObject or is it not
possible for some reason?

-- 
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: Understanding clojure bindings

2010-11-27 Thread Eduardo Julian
You might wanna check out the post I recently made and the answer by
Ken Wesson: 
http://groups.google.com/group/clojure/browse_thread/thread/9b042a2ddb8017aa
It's basically the same thing.

-- 
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: precise numbers

2010-10-14 Thread Julian
For the sake of comparison with other LISPs - some Scheme
implementations have an exact? function for dealing with non-precise
numbers.

This seems not to have come across to Clojure. (Although we do have
ratios and BigInteger).

JG

-- 
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: Little LISPer and Ten Commandments

2010-09-23 Thread Julian
I concur - that book is amazing.

Steve Yegge mentions he worked through the whole book in Scheme and
then Common LISP.
http://steve-yegge.blogspot.com/2006/06/shiny-and-new-emacs-22.html
(and he mentioned recently he was taking a look at Clojure.)

It looks like there is a blog or two online that work through it.
There also appear to be some guys on twitter talking about it.

My favourite bit is how you build the scheme evaluator at the end.

JG

On Sep 23, 6:10 am, David Sletten da...@bosatsu.net wrote:
 That book is amazing. Enjoy working through it, it will stretch your mind.

 However, keep in mind that their emphasis is on getting a feel for how 
 recursion works. Real world Clojure code (any Lisp really) de-emphasizes 
 recursion to some extent. Particularly with regard to list (sequence) 
 processing (the name Lisp comes from List processing after all), Clojure 
 has a powerful library of functions that handle much of what the book 
 implements recursively. For example, if you would like to apply a function f 
 to each element in a list you could write code similar to the book:
 (defn my-map [f l]
   (cond (empty? l) '()
         :else (cons (f (first l)) (my-map f (rest l )

 (my-map inc '(1 2 3 4 5)) = (2 3 4 5 6)

 Here we apply the First Commandment--is the list l empty? If so, return an 
 empty list. Otherwise, apply the function to the first element of the list 
 and recursively process the rest of the list.

 We could accomplish the same thing more succinctly in Clojure like this:
 (map inc '(1 2 3 4 5)) = (2 3 4 5 6)

 Clojure has a built-in 'map' function which iterates over each element in a 
 sequence, not merely lists:
 (map dec [2 4 6 8]) = (1 3 5 7)
 (map #(Character/toUpperCase %) Is this not pung?) = (\I \S \space \T \H 
 \I \S \space \N \O \T \space \P \U \N \G \?)

 Furthermore, the book is pretty much using a dialect of Lisp called Scheme, 
 and the semantics are a little different from Clojure. For instance, Clojure 
 does not have the concept of 'atom'.

 It may actually be easier to work through the book in a Scheme environment (I 
 used Common Lisp though). But what you learn there will help you later with 
 Clojure.

 In fact, if you are brave here is some of the material from chapter 9 dealing 
 with the Y-Combinator implemented in Clojure. It's pretty 
 weird:http://groups.google.com/group/clojure/browse_thread/thread/c9bd4e79e...

 Have all good days,
 David Sletten

 On Sep 21, 2010, at 6:38 PM, ax2groin wrote:



  Newbie here, to both LISP and Clojure. A friend has lent me a copy of
  The Little LISPer and I've started working through it, using some
  web resources to translate it into clojure.

  My questions: How relevant are the ten commandments? What modification
  need to be made ... either to the commandments or to your code in
  clojure?

  I ask because the first commandment (always ask null?) hasn't
  translated directly into any single statement for me. I can achieve
  the same with (or) to navigate the difference between nil and () in
  clojure, but sure that difference is in there for a reason.

  Any other input on the other commandments or using the book in
  general?

  Thanx

  --
  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


maturity and usefulness: clj-haml vs haml-macro

2010-06-21 Thread Julian
I'm about to start a new project using haml in clojure and I wanted to
know at the present time (Jun 2010) - is clj-haml or haml-macro more
mature?

-- 
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


Rich Hickey Video - unit conversion language

2010-06-21 Thread Julian
Rich Hickey made reference in one of his videos to a language that
could convert between all different kinds of units and dimensions.
Does anybody recall what that was?

-- 
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


Problem: Multimethod Dispatch Function

2010-04-14 Thread Eduardo Julian
I'm working on an object system called Fenrir, and one of the
functions in my library, called new-obj, is used to make instances of
classes:

(defmulti new-obj #(:_fenrir_class-name %))
(defmethod new-obj ::fObject [fclass  kvals]
(with-meta (apply struct-map (conj kvals (:_fenrir_struct fclass)))
{:_fenrir_class (:_fenrir_class-name fclass)}))

In fObject, the class which all other classes extend, I have
implemented the basic mechanisms for setting slots in struct-objects.
However, when I call the multimethod with something like this:

(new-obj fGameObject :location 'a-loc :sprite 'a-sprite)

I get this error:

1:14 yggdrasil.fenrir.core= java.lang.IllegalArgumentException: Wrong
number of args passed to: core$fn (repl-1:13)

That sort of thing has also happened to me with other multimethods I'm
working on.

Could anybody help me?

-- 
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

To unsubscribe, reply using remove me as the subject.


Re: Full Disclojure - I Need Topics!

2010-01-27 Thread Julian Adams
+1 for debugging

2010/1/27 Joonas Pulakka joonas.pula...@gmail.com

 On Jan 27, 7:17 am, Mark Engelberg mark.engelb...@gmail.com wrote:
  Topic idea: What is the most elegant way to write a GUI in Clojure?
  (Swing?  JavaFX?)  Any great contrib libraries that make GUI programming
  noticeably easier?

 I have to mention MiGLayout (http://www.miglayout.com/) and its
 Clojure wrapper (http://richhickey.github.com/clojure-contrib/
 #miglayout http://richhickey.github.com/clojure-contrib/%0A#miglayout).
 Without MiGLayout, doing Swing GUIs is horrible. With it,
 it's fun!

 Best Regards,
 Joonas

 --
 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.comclojure%2bunsubscr...@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

Matt Raible: Why is Clojure better than Scala or Groovy?

2010-01-16 Thread Julian
Matt Raible - Spring Expert and Java consultant posted the following
entry to Twitter:
Why is Clojure better than Scala or Groovy?
http://twitter.com/mraible/status/7793457551

He went on to say:
Let's try that again: I like Scala and Groovy and see no compelling
reason to learn Clojure. Am I missing something?
http://twitter.com/mraible/status/7794565786

I know that I think - but I thought the awesome community here could
help answer this question.
-- 
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: Clojure + Redis

2010-01-01 Thread Julian Morrison
Oops, typo - I meant, doesn't have hashes.

On Jan 1, 9:07 pm, Julian Morrison julian.morri...@gmail.com wrote:
  It doesn't have sets exactly - just keys and values.

-- 
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: If you wish to have a version for off-line use...

2009-09-22 Thread Julian

Did you mean this?
http://clojure.googlegroups.com/web/manual.pdf

On Sep 20, 4:59 am, cej38 junkerme...@gmail.com wrote:
 I was just looking through the main web page of clojure-contrib and
 came across this:

 If you wish to have a version for off-line use you can use the
 download button on the  page at GitHub .gh-pages branch.

 Is there a similar repository for the clojure.org?

--~--~-~--~~~---~--~~
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: Writing a GUI with clojure

2009-08-05 Thread Julian

On Aug 6, 6:51 am, Joe Van Dyk joevan...@gmail.com wrote:
 You wouldn't want to whip up a quick example (or blog post) for me,
 would ya?
Taking a quick look in the files section of this group found this:
http://clojure.googlegroups.com/web/clojure-gui-and-netbeans.pdf?hl=engda=f1jT-U4AAAC-wnUK1KQ919yJcmM1ACuZF_7r2-2rkSjhF_gc_N1Bbpenpc0tTgTfOT8mbP3D_UHFOPRGngYCB6zi_choflON47Cl1bPl-23V2XOW7kn5sQ

=)
JG

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



neo4j-clojure

2008-12-06 Thread Julian Morrison

A wrapper for neo4j, which is a non-relational database using a
network of nodes with properties and traversable relationships.

This is my first Clojure wrapper library, I've tried to keep the
spirit of Clojure by only wrapping things that were verbose or un-
lispy. Please comment and critique. Patches welcome.

http://github.com/JulianMorrison/neo4j-clojure/tree/master
--~--~-~--~~~---~--~~
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
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Re: neo4j-clojure

2008-12-06 Thread Julian Morrison

Not papers, but...

http://en.wikipedia.org/wiki/Network_database
http://en.wikipedia.org/wiki/Navigational_database

Neo4j is basically a really old design refreshed. The advantages are
that it's fast, dynamic, and schema-free, and fairly lispy in its
inherently recursive structure. The disadvantages are that it's messy,
can't be joined but only traversed (this is bad especially for data
mining and reporting), is hard to data dump, and at the moment neo4j
runs in-process with no multi-user access.

On Dec 6, 10:09 pm, jim [EMAIL PROTECTED] wrote:
 Hey, I was just looking at neo4j last night.  Can you point me to any
 papers about the theory behind those kinds of a databases?

 Thanks,
 Jim

 On Dec 6, 3:15 pm, Julian Morrison [EMAIL PROTECTED] wrote:

  A wrapper for neo4j, which is a non-relational database using a
  network of nodes with properties and traversable relationships.

  This is my first Clojure wrapper library, I've tried to keep the
  spirit of Clojure by only wrapping things that were verbose or un-
  lispy. Please comment and critique. Patches welcome.

 http://github.com/JulianMorrison/neo4j-clojure/tree/master
--~--~-~--~~~---~--~~
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
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---