Re: Refactoring tools

2013-03-22 Thread Daniel Glauser
I feel your pain, would love to see some Clojure refactorings. I had 
started working on the 1.3 branch of clojure-refactoring trying to bring it 
up to speed. I met with Tony (the original author of clojure-refactoring) 
and Phil H. at Clojure/West. Tony was very adamant that we ditch his code 
and start over. Currently I'm doing some experimenting with sjacket 
(https://github.com/cgrand/sjacket) trying to see if we could make that 
work for renaming. Once I'm confident that direction will work I'm happy to 
throw some code up on Github. If someone beats me to it then I'd like to 
contribute to their project.

I just created a #clojure-refactoring channel up on Freenode to make it 
easier to collaborate. We can rename the node once a name emerges for a new 
project.

On Thursday, March 21, 2013 12:12:42 AM UTC-6, Akhil Wali wrote:

 A fairly new project for refactoring Clojure is clj-refactor.el.
 Not too much functionality yet, but supplements clojure-refactoring pretty 
 well. 
 clj-refactor.el will later interop with nRepl, or that's the plan I heard.

 That aside (and I know I'm being redundant), refactoring any Lisp is a 
 snap with paredit-mode.
 It doesn't do stuff like renaming a function or exracting a var, but I've 
 had some success in making these operations as interactive functions. 



 On Thu, Mar 21, 2013 at 8:11 AM, Devin Walters dev...@gmail.comjavascript:
  wrote:

 Yeah it sort of bums me out that clojure-refactoring has been in the 
 ditch.

 There are a number of tasks to get this back into a good state. The plan 
 right now is to take tests (which were mostly failing and using outdated 
 dependencies) from the old-test directory and get them passing under Midje. 
 Then, get it to play nicely with nrepl and update any elisp that needs 
 updating to bring back the clojure-refactoring minor mode.

 If anyone wants to help resurrect this project: 
 https://github.com/devn/clojure-refactoring/tree/clojure-1.5 your help 
 would be appreciated. I created a new branch and started bringing old 
 failing tests over. Feel free to drop me a pull request. Big, sweeping 
 commits and tiny typo commits are both equally welcome.
  
 On Wednesday, March 20, 2013 at 8:22 PM, Dave Kincaid wrote:

 Thanks. It looks like nothing has happened on that in a year and it 
 appears to require slime/swank. But it's a start I guess if there isn't 
 anything else.

 On Wednesday, March 20, 2013 6:13:30 PM UTC-7, Devin Walters (devn) wrote:

  I don't think much has happened with it recently, but I used to use 
 https://github.com/joodie/**clojure-refactoringhttps://github.com/joodie/clojure-refactoring
 .

 -- 
 '(Devin Walters)
 Sent from my Motorola RAZR V3 (Matte Black)

 On Wednesday, March 20, 2013 at 8:05 PM, Dave Kincaid wrote:

 I'm wondering if there are any refactoring tools around for working with 
 Clojure projects in Emacs. There seems to be all kinds of other tools 
 except for refactoring. I'm really looking for simple things like ways to 
 easily rename variables, functions, namespaces, etc. That seems to be the 
 most common thing I'm trying to do. Are there any tools out there to make 
 it easier?

 Thanks,

 Dave

 -- 
 -- 
 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=enhttp://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/**groups/opt_outhttps://groups.google.com/groups/opt_out
 .
  
  
  

  -- 
 -- 
 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
 --- 
 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 javascript:.
 For more options, visit https://groups.google.com/groups/opt_out.
  
  
  
  
  -- 
 -- 
 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 

Re: [clj-power] Improving visibility of clojure-doc.org

2013-02-27 Thread Daniel Glauser
I added a link to http://clojure-doc.org in both the group discussion and 
the about page for the Den of Clojure 
(http://www.meetup.com/denofclojure/). Sean (or anyone else for that 
matter) is there an easy way we can let the rest of the user group to lend 
a hand? Is there a better place to post the link on the meetup site?

Daniel

On Wednesday, February 27, 2013 12:55:09 PM UTC-7, Alex Miller wrote:

 I've updated http://clojure.org/documentation to add a link to 
 http://clojure-doc.org. I think it's a great resource for all Clojure 
 developers!! 

 I think it would be useful in your regular updates to highlight areas that 
 could use help. Another area that I think would be useful in addition to 
 the current docs are smallish examples of full projects that highlight how 
 to put the existing pieces together into a (small) real project.

 Alex


 On Wed, Feb 27, 2013 at 12:06 PM, Michael Klishin 
 michael@gmail.comjavascript:
  wrote:

 Started in October 2012, http://clojure-doc.org is a pretty extensive
 community documentation effort. It covers Clojure, its ecosystem
 and tools and has two key goals:

  * We produce beginner-friendly content
  * It is dead easy to join and help

 Even though recently that hasn't been
 as much activity as in the past, it is not abandoned and continues
 to accumulate useful, beginner-friendly material.

 We constantly get praises from newcomers to Clojure who discover
 clojure-doc.org. Unfortunately, it does not appear even in top 10
 in Google for clojure docs or clojure documentation and
 many community members are not aware of it.

 In part it is less visible because we no longer actively post
 progress reports. Things have settled down and most of changes
 now are small edits and improvements all over the place. It is
 a bit pointless to post progress reports more often than
 once a month or so.

 So I'd like to start a discussion about what can be done about it.
 The community (we have 40 contributors) has worked very hard
 on clojure-doc.org and I'd like to see high profile resources
 (namly clojure.org and leiningen.org) link to it. What would
 it take to convince clojure.org maintainers to do so?

 There are still guides left ot be written (macros, gen-class),
 but overall, I'd say there is no better source of freely available,
 beginner-friendly, hackable (no Clojure CA, everything is developed
 on GitHub [1], content is in Markdown) documentation. All it needs
 is some linking and promotion love.

 One way to help would be to start a campaign such as Mozilla's
 Promote JS [docs]. Unfortunately, unlike Mozilla key contributors
 behind clojure-doc.org largely lack graphic and Web design skills,
 so replicating that campaing is probably not an option.

 Do you have any ideas about how we can make clojure-doc.org more
 visible? Do you know who can help with getting a link from clojure.org?
 Do you think clojure-doc.org is not good enough to be the blessed
 open source documentation resource? Please post your suggestions
 and concerns.

 Improving CDS visibility will benefit the entire community plus all the 
 people who will join it in the future. Most of the work is already done,
 it just needs to be promoted better.

 Thanks you.


 1. https://github.com/clojuredocs/cds
  
 -- 
 MK

 http://github.com/michaelklishin
 http://twitter.com/michaelklishin
  
 -- 
 You received this message because you are subscribed to the Google Groups 
 clojure-power group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to clojure-powe...@googlegroups.com javascript:.
 To post to this group, send email to clojur...@googlegroups.comjavascript:
 .
 Visit this group at http://groups.google.com/group/clojure-power?hl=en.
 For more options, visit https://groups.google.com/groups/opt_out.
  
  




-- 
-- 
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: Can't use Clojure 1.5 with emacs and swank

2013-02-11 Thread Daniel Glauser
The momentum is definitely headed the nrepl direction but if you do want to 
get Clojure 1.5 working with slime/swank you can just bump the lein-swank 
plugin to the latest version, 1.4.5. I tried this tonight and played with 
some reducer code, everything seems to be working.

Cheers,
Daniel

On Monday, February 11, 2013 4:35:36 PM UTC-7, Devin Walters (devn) wrote:

 That's definitely the issue. Switch to nrepl or see if there's an updated 
 swank-clojure. I switched and it took some getting used to and hackery to 
 get it working like my swank setup did, but I think it was worth it.

 '(Devin Walters)

 On Feb 11, 2013, at 5:01 PM, David Nolen dnolen...@gmail.comjavascript: 
 wrote:

 I'm not sure if swank-clojure has been patched for 1.5, I believe the line 
  column information changes might have broken things.

 nrepl.el works pretty well as a replacement and development seems to be 
 moving along pretty quickly.

 David 


 On Mon, Feb 11, 2013 at 5:53 PM, JvJ kfjwh...@gmail.com javascript:wrote:

 I added 1.5.0-beta13 to my lein project file, and now I get something 
 like this when I try M-x clojure-jack-in


  signal(error (Could not start swank server: ...etc...


 Does anyone know what I should do about this?

 Thanks.

 -- 
 -- 
 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
 --- 
 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 javascript:.
 For more options, visit https://groups.google.com/groups/opt_out.
  
  


  -- 
 -- 
 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 javascript:
 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
 --- 
 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 javascript:.
 For more options, visit https://groups.google.com/groups/opt_out.
  
  



-- 
-- 
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: `let` to automatically add metadata / fn names?

2013-02-08 Thread Daniel Glauser

This sounds like a great idea. I was working with some tests today and it 
would have been really useful to have some way to query the current 
function/execution context. Seems like passing that through all lets would 
go a long way, provided I'm reading this right.

On Friday, February 8, 2013 10:18:54 AM UTC-7, vemv wrote:

 Given that: a) fns can have names for debugging purposes, and b) data 
 structures can have metadata, wouldn't it be a good idea to let let auto 
 attach (where possible) the names of the bindings to their corresponding 
 values?

 For example, the improved let I'm thinking of would translate this input:

 (ns my.namespace)

 (defn do-it
   (let [foo (fn [] (throw (Exception.)))
 bar {:hello (/ 0 0)}]))

 to:

 (ns my.namespace)

 (defn do-it
   (let [foo (fn foo [] (throw (Exception.)))
 bar ^{:origin :my.namespace/do-it$let$bar} {:hello (/ 0 0)}]))

 This could be used to increase the precision of the stack traces, or in 
 IDEs/editors for locating the exact source of an exception.

 Do you see such a mechanism being incorporated to clojure.core/let - 
 should I open a ticket?


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




Starting a new ClojureScript project, where to start?

2012-09-28 Thread Daniel Glauser
Hi folks,

Where would you point someone if they wanted guidance starting a new 
ClojureScript project?  I friend who's big into 
CoffeeScript/Backbone/Require and is looking to kick off a side project 
with ClojureScript.  He's sold on Clojure but looking for some guidance. 
 We checked out Pinot which is now broken up:
https://groups.google.com/d/msg/clj-noir/wsCVajG0-YE/CaFa3FTU7B0J

Are there any sample apps with the new libraries?

I cruised by ClojureScriptOne which is the most expansive ClojureScript 
sample I've seen.  The last commit was eight months ago and some of the 
libs look a bit stale in project.clj. Is ClojureScriptOne still a good 
sample to point folks at or have things changed significantly?

On a separate note I finally have Clojure in production!  It's working 
great and development is moving forward.  It's currently a Noir app. 
 Looking to roll in Friend and Datomic shortly.  From there I hope to 
publish a sample app, with all these well written disconnected libraries it 
seems like we could use more examples of how to put them together.  Ping me 
if you'd like to help.

If any Clojure folks are coming through Denver and would be willing to lead 
a topic at the Den of Clojure we would love to have you.  We do accept 
presenters but encourage folks to focus on leading a topic and keeping the 
meetings more hands on.
http://www.meetup.com/Denver-Clojure-Meetup/

Cheers,
Daniel

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

Emacs: Optimize Imports?

2012-01-01 Thread Daniel Glauser
Hello folks,

Does anyone know a way with Emacs/Leiningen/Slime/Swank to ask the
system to optimize the imports?  I'm looking for something similar to
the way Intellij does things:

http://www.jetbrains.com/idea/webhelp/optimizing-imports.html

Converting existing Java example to Clojure and many of the examples
don't include import statements.  Working with recursive greps and
opening the JARs in Emacs helps but I just wanted to ask around if
anyone has an easier way.  Tried bringing the project into Intellij
with the Leiningen and La Clojure plugins but Code-Optimize Imports
is disabled.

Looks like this was asked about previously but no answer was reached.
http://groups.google.com/group/clojure/browse_thread/thread/98f985926f096850/602f8ff61ec735ae?lnk=gstq=emacs+imports#602f8ff61ec735ae

Cheers,
Daniel

-- 
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: Emacs: Optimize Imports?

2012-01-01 Thread Daniel Glauser
Perfect.  Thanks!

On Jan 1, 12:05 pm, gaz jones gareth.e.jo...@gmail.com wrote:
 I believe this might be what close to what you are looking for:

 https://github.com/technomancy/slamhound







 On Sun, Jan 1, 2012 at 1:03 PM, Daniel Glauser danglau...@gmail.com wrote:
  Hello folks,

  Does anyone know a way with Emacs/Leiningen/Slime/Swank to ask the
  system to optimize the imports?  I'm looking for something similar to
  the way Intellij does things:

 http://www.jetbrains.com/idea/webhelp/optimizing-imports.html

  Converting existing Java example to Clojure and many of the examples
  don't include import statements.  Working with recursive greps and
  opening the JARs in Emacs helps but I just wanted to ask around if
  anyone has an easier way.  Tried bringing the project into Intellij
  with the Leiningen and La Clojure plugins but Code-Optimize Imports
  is disabled.

  Looks like this was asked about previously but no answer was reached.
 http://groups.google.com/group/clojure/browse_thread/thread/98f985926...

  Cheers,
  Daniel

  --
  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: Using Clojure on a Mac

2011-11-28 Thread Daniel Glauser
I recommend A and B, used to do C.  That is install Clojure with
Homebrew so you can quickly pull up a REPL to try things.  To start
the REPL you run clj as in /usr/local/bin/clj.  I was expecting it
to be called clojure and that threw me off a bit.

When doing a project of any size whatsoever Leiningen is great, super
simple, get's out of your way, manages classpath and dependency issues
and let's you focus more on the problem you are trying to solve and
less on managing your project.  If you want a REPL that loads the
projects dependencies it's as simple as lein repl.  I know of a
handful of hardcore Clojure folks who only interact with Clojure
through Leiningen.

What Chris mentioned is the traditional way to execute Clojure since
the runtime is simply a jar that needs to be on the classpath when
invoking the Java Virtual Machine.  I used to wrap that call in a
shell script but now Homebrew does that for me.  Less management
around upgrades.

Cheers,
Daniel

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


contrib.duck-streams or contrib.io?

2011-11-24 Thread Daniel Glauser
Hello folks,

I starting to do some simple file IO stuff with Clojure and was
wondering which namespace was considered the best one to use,
contrib.duck-streams on contrib.io?  There seems to be a bit of
overlap between the two and at least some of the functions with the
same names have different implementations (I looked at write-lines).

A query against ClojureDocs for write-lines shows that it's defined in
two namespaces:
http://clojuredocs.org/search?x=0y=0q=write-lines

Just trying to figure out which is the most recent/up to date/one that
folks recommend moving forward.

Thanks,
Daniel

-- 
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: cool compiler-project?

2010-08-23 Thread Daniel Glauser
I thought that much of the driver behind protocols and records were to
support the Clojure-in-Clojure effort.
Can anyone confirm?

Thanks,
Daniel


On Aug 23, 3:59 am, nickikt nick...@gmail.com wrote:
 I think he talkes about automatic detection where memoization would be
 good for performence. I don't think it is done ATM but I would surly
 be a intressting topic.

 The Clojure compiler is still in Java. I think befor someone does a
 big project with the compiler it should be translated to clojure. I
 think Rich said once that the compiler is about 5000 lines so its not
 an imposibly hard task.

 On Aug 23, 9:01 am, Moritz Ulrich ulrich.mor...@googlemail.com
 wrote:



  Memoization is implemented at language-leve. The function is called memoize.
  (It's a three-liner or so)

  On Sun, Aug 22, 2010 at 11:45 PM, Sreeraj a writeto...@gmail.com wrote:
   What about automatic memoization?
   Does clojure already implement memoization?
   is adding auto memoization to the compiler a good idea?

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

  --
  Moritz Ulrich
  Programmer, Student, Almost normal Guy

 http://www.google.com/profiles/ulrich.moritz
  BB5F086F-C798-41D5-B742-494C1E9677E8

-- 
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: Is there an easier way to code this? Destructuring?

2010-07-30 Thread Daniel Glauser
Hi Joe, Laurent and Nikita,

Thanks for your help, the destructuring form of [[k v]] is much
cleaner, that's exactly what I was looking for.
Nikita, thanks for catching the typo and the misplaced paren, the code
is working smoothly now.

I have problem coded in Java, I plan to complete the Clojure version
and enhance both versions to support concurrent baristas and
customers.  I'll post the code up in GitHub when I'm done if anyone
else would like the use the examples.

Cheers,
Daniel

On Jul 29, 7:49 am, joegg joega...@gmail.com wrote:
 I agree with Laurent's idea that you should pull this out as a
 separate function, but I think the most direct answer to your question
 is that you can bind the map entries in a destructuring  as if they
 were two-element vectors.

 (map (fn [[ingr quant]] (* (cost ingr) quant)) (cookbook drink))

 Joe

 On Jul 28, 8:02 pm, Daniel Glauser danglau...@gmail.com wrote:



  Hello folks,

  I'm working on some sample code and I have a feeling that there is an
  easier/more succinct way to code this.  Any help or RTFM with a link
  is appreciated.

  Given:

  (def cookbook {:Coffee          {:coffee 3, :sugar 1, :cream 1},
                 :Decaf-Coffee    {:decaf 3, :sugar 1, :cream 1},
                 :Caffe-Late      {:espresso 2, :steamed-milk 1},
                 :Caffe-Americano {:espresso 3},
                 :Caffe-Moca      {:espresso 1, :coco 1, :steamed-milk
  1, :cream 1},
                 :Cappuccino      {:espresso 2, :steamed-milk 1, :foamed-milk
  1} })

  (def cost {:coffee        0.75,
             :decaf         0.75,
             :sugar         0.25,
             :cream         0.25,
             :steamed-milk  0.35,
             :foamed-milk   0.35,
             :espresso      1.00,
             :cocoa         0.90,
             :whipped-cream 1.00 })

  (def menu {:Coffee          1,
             :Decaf-Coffee    2,
             :Caffe-Late      3,
             :Caffe-Americano 4,
             :Caffe-Moca      5,
             :Cappuccino      6 })

  I'm trying to write a function to print out the menu listing the cost
  of each drink.  It works (sort of) but I keep thinking there is an
  easier way.

  (defn print-menu [menu]
    (do
      (println Menu:)
      (doseq [[drink number] menu]
        (println (str number ,  (drink-name drink) , 
                      (reduce +
                              (map (fn [map-entry] (* (cost (key map-entry) 
  (val map-
  entry (cookbook drink

  Specifically this part:
  (map (fn [map-entry] (* (cost (key map-entry) (val map-entry
  (cookbook drink))

  Is there a way I can get at the map key and value using destructuring
  without knowing what the key is ahead of time?

  Thanks,
  Daniel

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


Is there an easier way to code this? Destructuring?

2010-07-29 Thread Daniel Glauser
Hello folks,

I'm working on some sample code and I have a feeling that there is an
easier/more succinct way to code this.  Any help or RTFM with a link
is appreciated.

Given:

(def cookbook {:Coffee  {:coffee 3, :sugar 1, :cream 1},
   :Decaf-Coffee{:decaf 3, :sugar 1, :cream 1},
   :Caffe-Late  {:espresso 2, :steamed-milk 1},
   :Caffe-Americano {:espresso 3},
   :Caffe-Moca  {:espresso 1, :coco 1, :steamed-milk
1, :cream 1},
   :Cappuccino  {:espresso 2, :steamed-milk 1, :foamed-milk
1} })

(def cost {:coffee0.75,
   :decaf 0.75,
   :sugar 0.25,
   :cream 0.25,
   :steamed-milk  0.35,
   :foamed-milk   0.35,
   :espresso  1.00,
   :cocoa 0.90,
   :whipped-cream 1.00 })

(def menu {:Coffee  1,
   :Decaf-Coffee2,
   :Caffe-Late  3,
   :Caffe-Americano 4,
   :Caffe-Moca  5,
   :Cappuccino  6 })

I'm trying to write a function to print out the menu listing the cost
of each drink.  It works (sort of) but I keep thinking there is an
easier way.

(defn print-menu [menu]
  (do
(println Menu:)
(doseq [[drink number] menu]
  (println (str number ,  (drink-name drink) , 
(reduce +
(map (fn [map-entry] (* (cost (key map-entry) (val 
map-
entry (cookbook drink

Specifically this part:
(map (fn [map-entry] (* (cost (key map-entry) (val map-entry
(cookbook drink))

Is there a way I can get at the map key and value using destructuring
without knowing what the key is ahead of time?

Thanks,
Daniel

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


Broken Link in Clojure Contrib Docs

2010-06-08 Thread Daniel Glauser
Hello all,

Not sure where to report this but I noticed a broken link when taking
a look at the docs for sql in Clojure Contrib.

http://richhickey.github.com/clojure-contrib/sql-api.html

The link for Example code points here:

http://code.google.com/p/clojure-contrib/source/browse/trunk/src/clojure/contrib/sql/test.clj

Which is no longer around.  If I'm reporting this in the wrong place
then please let me know and I'll move the post.

Cheers,
Daniel

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


Examples of Clojure in production?

2010-04-19 Thread Daniel Glauser
I would like to start a thread about Clojure use in production.  Who
is using it?  And for what?  What kind of load do you have on the
system in terms of approximate transactions per day?  Would you mind
if your example was featured in a presentation?

About two months ago I agreed to defend Clojure in a language panel
alongside JRuby, Groovy and Scala.  I've really enjoyed learning
Clojure these past two months and have really appreciated the help of
the community.  A week before the language panel I gave two
presentations on the language, one intro and one about web
development.  During the language panel a point was made that I wasn't
using Clojure in production.  Sadly, I doubt I ever with at my current
position.  That being said I'd like to have examples of Clojure use in
production that I can add to my presentations.  It would be good for
the language in terms of acceptance, it is often easier for folks to
accept ideas like the language is fast and stable enough for prime
time if they can point to real live examples.

I'm happy to put the info together if folks don't mind posting it
here.  Feel free to email directly as well.  If (for some odd reason)
I can't mention your company I'd still appreciate hearing your
example, in what capacity are you using the language and how has the
experience been?

Thanks,
Daniel
danglau...@gmail.com

-- 
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: help wanted: tests for c.c.io

2010-04-18 Thread Daniel Glauser
Hi Stuart,

I would like to help as well.  Just signed up for Clojure Dev and an
Assembla account.  I'll send in my CA tomorrow.

id: danielglauser

Thanks,
Daniel


On Apr 15, 1:10 pm, Stuart Halloway stuart.hallo...@gmail.com wrote:
 You are added. Thanks!



  I'll take a stab at it.    Can you add me as a member of clojure-
  contrib space, or should I ask on Clojure Dev?   I've already
  submitted a CA and my assembla UN is josharnold

  On Apr 14, 9:50 pm, Stuart Halloway stuart.hallo...@gmail.com wrote:
  clojure.contrib.iois one of the most used libraries in contrib, and
  it has few automated tests. I have created a ticket for this [1]. If
  you haven't contributed to Clojure before, this is a gentle place to
  get started. You don't need to know Clojure deeply, and there are
  already some tests to help get you started.

  Thanks!
  Stu

  [1]http://www.assembla.com/spaces/clojure-contrib/tickets/75-tests-for-c
  ...

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

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