Re: ANN: Windows installer for Leiningen

2013-03-31 Thread Roberto Mannai
Hello,

Should one have Powershell pre-installed? The wizard does not complete
successfully the self-install step, although it seems as it is not
aware of it.

When running lein self-install manually, I get a
DotNetMethodException (*). Now I'd guess this is an issue of lein.bat,
not of your installer, anyway it would be nice if your package could
embed all the hidden dependencies, as it already does for curl.exe.

Kind regards,
Roberto

(*)
C:\Users\Roberto Mannai\.lein\binlein self-install
Downloading Leiningen now...
Eccezione durante la chiamata di DownloadFile con 2 argomento/i:
Eccezione  durante una richiesta WebClient.
In riga:1 car:63
+  {param($a,$f) (new-object System.Net.WebClient).DownloadFile  ($a, $f)}
 https://leiningen.s3.amazonaws.com/downloads/leiningen-2.1.2-standalone.jar C:
\Users\Roberto Mannai\.lein\self-installs\leiningen-2.1.2-standalone.jar.pendin
g
+ CategoryInfo  : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException



On Sat, Mar 30, 2013 at 6:39 PM, David Powell djpow...@djpowell.net wrote:
 Hi,

 I've put together an installer for Leiningen on Windows:
 http://leiningen-win-installer.djpowell.net/

 Hopefully it should make it a bit easier for Windows people to get Leiningen
 and a Clojure repl up and running.

 It requires a JDK to be installed first, but other than that there aren't
 any dependencies.
 It should work on Windows XP and above, 32-bit or 64-bit.  With or without
 powershell available.

 The installer should take the hassle out of setting up paths and environment
 variables, and changing them when new JDKs are installed.

 The current version is beta1.  If you've got any feedback then give me an
 email.

 --
 Dave

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



-- 
-- 
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: ANN: Windows installer for Leiningen

2013-03-31 Thread Roberto Mannai
C:\Users\Roberto Mannai\.lein\binpowershell -Command echo $host.version
Major  Minor  Build  Revision
-  -  -  
2  0  -1 -1


I'm doing some test, the problem seems to be this line:

powershell -Command  {param($a,$f) (new-object
System.Net.WebClient).DownloadFile($a, $f)} %~2 %~1

Where %~1 points to a path with a space inside:
C:\Users\Roberto
Mannai\.lein\self-installs\leiningen-2.1.2-standalone.jar.pending

[I can't believe both that in 2013 MS Windows does not handle such
cases, and that Windows Administrators still create User profiles with
spaces inside]

It should be enough to do a smarter string concation; I'll try later.

Thanks again,
Roberto


On Sun, Mar 31, 2013 at 3:45 PM, David Powell djpow...@djpowell.net wrote:
 Also, can you check what version of powershell you have?

   powershell -Command echo $host.version

 --
 Dave

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



-- 
-- 
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: ANN: Windows installer for Leiningen

2013-03-31 Thread Roberto Mannai
On Sun, Mar 31, 2013 at 5:23 PM, David Powell djpow...@djpowell.net wrote:

 I think that this patch fixes the issue:
 https://github.com/djpowell/leiningen/commit/bd9e2e25508cfc01889057349b133941ff4fc379

 It seems that quotes around powershell parameters on the command-line need
 to be triple-double-quoted :)

That's correct, now it works! :)

IMHO the patch should be just the line 83 of your file, the other
quoted variables are URLs (which cannot have spaces). Note that
:DownloadFile, when calls powershell, inverts the order of its
arguments.

Thanks again,
Roberto

 --
 Dave

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



-- 
-- 
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: tutorials or screencasts on debuggers in clojure?

2012-10-23 Thread Roberto Mannai
There is a ticket in CDS:
https://github.com/clojuredocs/cds/issues/27#issuecomment-9583049

On Wednesday, October 24, 2012, Warren Lynn wrote:

 +1. I just got the basic ritz-nrepl set up in the hope to try out the
 debugger. But I don't even know where to start. How to set a breakpoint,
 for example? I could not find it anywhere on the web or from Emacs
 apropos. I figured it must be so obvious to others and I must be so
 stupid... Thanks for bringing up this topic.


  --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to 
 clojure@googlegroups.comjavascript:_e({}, 'cvml', 
 '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 javascript:_e({}, 'cvml',
 'clojure%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

Re: code design in clojure

2012-10-18 Thread Roberto Mannai
See Functional Programming for the Object-Oriented Programmer (
https://leanpub.com/fp-oo)
Il giorno 18/ott/2012 19:01, Sean Corfield seancorfi...@gmail.com ha
scritto:

 On Thu, Oct 18, 2012 at 8:58 AM, Brian Craft craft.br...@gmail.comwrote:

 Clojure Programming, and The Joy of ...


 Hmm, I was going to suggest Joy of but if you don't think that helps with
 some of those design issues, I'm not sure what to suggest. Others suggested
 Clojure Programming but, again, if that doesn't help...

 At this point I'd certainly be interested in hearing suggestions from
 other people beyond those two books...?
 --
 Sean A Corfield -- (904) 302-SEAN
 An Architect's View -- http://corfield.org/
 World Singles, LLC. -- http://worldsingles.com/

 Perfection is the enemy of the good.
 -- Gustave Flaubert, French realist novelist (1821-1880)

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

[OT] Re: ANN clojure-doc.org (aka CDS), a new community-driven Clojure documentation site

2012-10-10 Thread Roberto Mannai
I'm pretty sure you have already thought about it and it's me that missed
your considerations, but why we are not using a wiki-based tool, like
Wordpress, instead of forking a git branch?

On Mon, Oct 8, 2012 at 6:25 PM, Michael Klishin michael.s.klis...@gmail.com
 wrote:

 ## Announcing clojure-doc.org

 I am starting a new thread because the existing one about CDS is now
 polluted by all kinds of off-topics.

 About a week ago, John Gabrielle announced CDS (Clojure Documentation
 Site): a new Clojure documentation resource
 for the Clojure community by the Clojure community.

 We are past dealing with all the plumbing and happy to announce that our
 work is now public at http://clojure-doc.org and
 you are welcome join the effort: we tried to make it as easy as possible.


 ## How It Works

 We have a repository on GitHub [1] that has Markdown files, toolchain
 setup instructions and several article
 stubs. The stubs help contributors pick a topic to write about and not
 worry too much about how to structure the document.
 They are training wheels for documentation writing, if you will.

 To contribute, for the repository [1], create a topic branch, make your
 changes and submit a pull request on GitHub. No
 contributor agreement process, no JIRA, no patches. Then an existing
 contributor will either merge your pull request or
 suggest changes.

 The toolchain currently requires Ruby *and* Python (for code
 highlighting). We decided that it's good enough for now.
 There are instructions about setting everything up in the README.

 There is no separate mailing list, so if you want to ask or suggest
 something, do it here.


 ## What We Have So Far

 Given that CDS is literally a few days old (after we migrated to the new
 toolchain and got to actual content), there is not
 much to show but a few tutorials and guides should give you an idea of
 what we want it to look like:

  * http://clojure-doc.org/articles/tutorials/getting_started.html
  * http://clojure-doc.org/articles/tutorials/introduction.html
  * http://clojure-doc.org/articles/language/functions.html
  * http://clojure-doc.org/articles/ecosystem/community.html
  * http://clojure-doc.org/articles/ecosystem/libraries_directory.html


 ## What CDS Covers

 CDS' goal is to cover more than just the language. It is certainly
 cruicially important to have good tutorials and comprehensive
 guides on Clojure. But when using Clojure in real world projects, you will
 need to know about the JVM ecosystem, Leiningen,
 how to write tests, what libraries are out there, how to profile code, JVM
 tooling for ops, how to develop and distribute libraires,
 and much more.

 So there is group of articles about the Ecosystem stuff: think
 Leiningen, popular libraries or how to use VisualVM to find
 hot spots and investigate concurrency hazards in your apps.

 This means that if you feel that documenting sequences is boring but
 excited about the ops side of software engineering, you
 can still contribute to CDS and enjoy the process.

  When documenting various tools, sometimes it makes more sense to just
 link to existing documentation, which is what we
 do for Leiningen.


 ## Low-hanging Fruits

 There are currently several articles that already have their structure in
 place, what is left is writing the content and code
 examples. For example, you don't have to be a genius or a Clojure expert
 to write articles such as

  * Books
  * Java interop
  * Collections and Sequences
  * Namespaces (ok, you *have* to be a genius to explain the ns macro well
 but some people certainly can do that)

 If you want to start working on one of those articles or have existing
 content you've authored that can be ported,
 please let us know.

 Topics like Concurrency  Parallelism and Laziness will take more effort,
 this is why we did not bother with writing any
 initial structure for their articles.


 ## Call to Arms

 If your company uses Clojure or has interest in adopting it and has open
 source Fridays, hacker time or something
 similar, consider contributing to CDS. This will literally benefit the
 entire Clojure community, all the current and future users.

 Not only every single Clojure user benefits from better documentation, it
 also gets outdated way slower than that hot new open source
 library you wanted to tinker with. In other words, it's one of the best
 ways to invest of your OSS time budget (if you ask me).

 No contribution is too small: feel free to suggest grammar improvements,
 better code examples, submit pull requests with just
 one new paragraph or even a couple of spelling corrections. Editing and
 proof-reading is also a great way to contribute.

 If you have design and/or frontend development skills, you are more than
 welcome to make CDS more legible, easy to navigate,
 and simply better looking.

 If you need examples of what's possible, here's what 2 people could
 produce in about 6 months in their spare time:

  * Monger documentation: 

Re: Error running clojure file.

2012-08-16 Thread Roberto Mannai
There is a return which splits # and { on the second set definition,
translating it into a map definition:

#
{10710,

After correcting it, I get a new curious error:
*Unknown constant tag 44 in class file user$eval1976*
* [Thrown class java.lang.ClassFormatError]*


On Thu, Aug 16, 2012 at 9:44 AM, Renat Yuldashev rena...@gmail.com wrote:

 See attached file(ros4.clj).
 Can not run the file on windows, clojure 1.4
 Don't know if it is a bug.
 Seems like standard parser can not handle long lines, because it works
 perfectly for smaller file(see the second file).

 error output:

 Exception in thread main clojure.lang.LispReader$ReaderException:
 java.lang.RuntimeException: Map literal must contain an even number of
 forms, compiling:(U:\ros4_t.clj:16)
 at clojure.lang.Compiler.load(Compiler.java:6958)
 at clojure.lang.Compiler.loadFile(Compiler.java:6912)
 at clojure.main$load_script.invoke(main.clj:283)
 at clojure.main$script_opt.invoke(main.clj:343)
 at clojure.main$main.doInvoke(main.clj:427)
 at clojure.lang.RestFn.invoke(RestFn.java:408)
 at clojure.lang.Var.invoke(Var.java:415)
 at clojure.lang.AFn.applyToHelper(AFn.java:161)
 at clojure.lang.Var.applyTo(Var.java:532)
 at clojure.main.main(main.java:37)
 Caused by: clojure.lang.LispReader$ReaderException:
 java.lang.RuntimeException: Map literal must contain an even number of forms
 at clojure.lang.LispReader.read(LispReader.java:215)
 at clojure.lang.LispReader$CtorReader.invoke(LispReader.java:1148)
 at clojure.lang.LispReader$DispatchReader.invoke(LispReader.java:611)
 at clojure.lang.LispReader.readDelimitedList(LispReader.java:1126)
 at clojure.lang.LispReader$ListReader.invoke(LispReader.java:962)
 at clojure.lang.LispReader.read(LispReader.java:180)
 at clojure.lang.Compiler.load(Compiler.java:6949)
 ... 9 more
 Caused by: java.lang.RuntimeException: Map literal must contain an even
 number of forms
 at clojure.lang.Util.runtimeException(Util.java:170)
 at clojure.lang.LispReader$MapReader.invoke(LispReader.java:1071)
 at clojure.lang.LispReader.read(LispReader.java:180)
 ... 15 more

  --
 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: Error running clojure file.

2012-08-16 Thread Roberto Mannai
Wrapping the huge sets into vars makes it work:
https://gist.github.com/3369040

The first literal set works if it contains just the first 3282 elements (
https://gist.github.com/3369092). One element more and it does not work
anymore (https://gist.github.com/3369101) - throwing a CompilerException
java.lang.ClassFormatError: Invalid method Code length 65542 in class file
user$eval138, compiling:(NO_SOURCE_PATH:0)

Maybe this is a JVM issue (
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4262078), anyway it is
weird that its occurrence depends on whether we are defining a var or not.

On Thu, Aug 16, 2012 at 11:32 AM, Roberto Mannai roberm...@gmail.comwrote:

 There is a return which splits # and { on the second set definition,
 translating it into a map definition:

 #
 {10710,

 After correcting it, I get a new curious error:
 *Unknown constant tag 44 in class file user$eval1976*
 * [Thrown class java.lang.ClassFormatError]*


 On Thu, Aug 16, 2012 at 9:44 AM, Renat Yuldashev rena...@gmail.comwrote:

 See attached file(ros4.clj).
 Can not run the file on windows, clojure 1.4
 Don't know if it is a bug.
 Seems like standard parser can not handle long lines, because it works
 perfectly for smaller file(see the second file).

 error output:

 Exception in thread main clojure.lang.LispReader$ReaderException:
 java.lang.RuntimeException: Map literal must contain an even number of
 forms, compiling:(U:\ros4_t.clj:16)
  at clojure.lang.Compiler.load(Compiler.java:6958)
 at clojure.lang.Compiler.loadFile(Compiler.java:6912)
 at clojure.main$load_script.invoke(main.clj:283)
  at clojure.main$script_opt.invoke(main.clj:343)
 at clojure.main$main.doInvoke(main.clj:427)
 at clojure.lang.RestFn.invoke(RestFn.java:408)
  at clojure.lang.Var.invoke(Var.java:415)
 at clojure.lang.AFn.applyToHelper(AFn.java:161)
 at clojure.lang.Var.applyTo(Var.java:532)
  at clojure.main.main(main.java:37)
 Caused by: clojure.lang.LispReader$ReaderException:
 java.lang.RuntimeException: Map literal must contain an even number of forms
  at clojure.lang.LispReader.read(LispReader.java:215)
 at clojure.lang.LispReader$CtorReader.invoke(LispReader.java:1148)
  at clojure.lang.LispReader$DispatchReader.invoke(LispReader.java:611)
 at clojure.lang.LispReader.readDelimitedList(LispReader.java:1126)
  at clojure.lang.LispReader$ListReader.invoke(LispReader.java:962)
 at clojure.lang.LispReader.read(LispReader.java:180)
  at clojure.lang.Compiler.load(Compiler.java:6949)
 ... 9 more
 Caused by: java.lang.RuntimeException: Map literal must contain an even
 number of forms
  at clojure.lang.Util.runtimeException(Util.java:170)
 at clojure.lang.LispReader$MapReader.invoke(LispReader.java:1071)
  at clojure.lang.LispReader.read(LispReader.java:180)
 ... 15 more

  --
 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: Attractive examples of function-generating functions

2012-08-16 Thread Roberto Mannai
I don't have my own examples, anyway being a daily object-oriented
programmer I'm feeling compelled to say that where function-generating
functions prove their main practical power is in what I'd label man in
the middle functions.

Whenever I need to add behaviour to an existing OO method I have to
subclass or introduce an indirection by interface, applying a decorator
pattern et similia, or to apply some aspect oriented programming. Instead
in Clojure you can more easily replace that function by an hooked-one (
https://github.com/technomancy/robert-hooke/) or by hand-written wrapping
functions (http://vimeo.com/channels/fulldisclojure/38507385).

If a Java programmer find a little weird the typical decorator usage of the
java.io.InputStream hierarchy (based on class inheritance) to the point
it's been proposed a different hierarchy designed on interfaces (see the
PragPub Interface Oriented Design book), I guess that the possibility of
writing compoundable chains of functions can further improve the general
design of what we write day-by-day.

So if you are searching for practical examples I'd suggest to look for such
use cases, although their best application IMHO has to be found not in
business code but in utility libraries/frameworks, such as ring handlers.

On Wed, Aug 8, 2012 at 6:48 PM, Brian Marick mar...@exampler.com wrote:

 I'm looking for medium-scale examples of using function-generating
 functions. I'm doing it because examples like this:

 (def make-incrementer
  (fn [increment]
(fn [x] (+ increment x

 ... or this:

 (def incish (partial map + [100 200 300]))

 ... show the mechanics, but I'm looking for examples that would resonate
 more with an object-oriented programmer. Such examples might be ones that
 close over a number of values (which looks more like an object), or
 generate multiple functions that all close over a shared value (which looks
 more like an object), or use closures to avoid the need to have some
 particular argument passed from function to function (which looks like the
 `this` in an instance method).

 Note: please put the flamethrower down. I'm not saying that looking like
 objects is the point of higher-order functions.

 I'll give full credit.

 -
 Brian Marick, Artisanal Labrador
 Contract programming in Ruby and Clojure
 Occasional consulting on Agile


 --
 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: Overtone - Actual Music!

2012-08-16 Thread Roberto Mannai
+1

On Wed, Aug 15, 2012 at 1:05 PM, Bruce Durling b...@otfrom.com wrote:

 Sam,

 That's amazing. Thanks for posting that. :-D

 cheers,
 Bruce

 On Wed, Aug 15, 2012 at 11:50 AM, Sam Aaron samaa...@gmail.com wrote:
  Hey everyone,
 
  sorry, I couldn't resist posting this, but I'm getting real close to
 making decent music with Overtone now, and I just wanted to share with you
 where I'm at:
 
  https://vimeo.com/47578617
 
  I think the coolest thing about this is that what you see in the
 screencast is something you can clone from Github *now* and play with
 today. That music is an instrument that you can control - and trust me,
 it's more fun to play with than it is to listen to :-)
 
  Let me know if you like it.
 
  Sam
 
  ---
  http://sam.aaron.name
 
  --
  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



 --
 @otfrom | CTO  co-founder @MastodonC | mastodonc.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


-- 
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: Attractive examples of function-generating functions

2012-08-16 Thread Roberto Mannai
typo, I meant ring *middleware*, not ring handlers

On Thu, Aug 16, 2012 at 1:01 PM, Roberto Mannai roberm...@gmail.com wrote:


 So if you are searching for practical examples I'd suggest to look for
 such use cases, although their best application IMHO has to be found not in
 business code but in utility libraries/frameworks, such as ring handlers.

 [...]


-- 
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: Overtone - Live @ Arnolfini

2012-08-07 Thread Roberto Mannai
+1. The piano composition is reminescent of some Gurdjieff/De Hartmann
music. I liked too the live coding gestures, where I track down your Emacs
key bindings and your flowing among buffers. BTW, how did you update the
values of that blue numerical sliders? By mouse?

On Sunday, August 5, 2012, Granville Barnett wrote:

 That's amazing ;-)

 Granville

 On 5 August 2012 19:11, Sam Aaron samaa...@gmail.com javascript:_e({},
 'cvml', 'samaa...@gmail.com'); wrote:


 On 4 Aug 2012, at 17:23, Tom Maynard tom.w...@gmail.comjavascript:_e({}, 
 'cvml', 'tom.w...@gmail.com');
 wrote:

  Bravo!  Standing ovation.  Technical difficulties be d*mned, that was a
 spectacular exhibition.  I was reminded of a live premiere performance by
 Karlheinz Stockhausen that I attended at the NASA auditorium in Galveston,
 Texas, USA mumble-mumble years ago: totally captivating, fully engaging,
 and thrilling and motivating.  Hypnotic, it was.

 Wow, thanks for the very generous words. Hopefully we'll start to see
 more people playing with and having fun with Overtone and Quil.

 Programming is not just for industry, but for expressing yourself too :-)

 Exciting times!

 Sam

 ---
 http://sam.aaron.name

 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to 
 clojure@googlegroups.comjavascript:_e({}, 'cvml', 
 '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 javascript:_e({}, 'cvml',
 'clojure%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.comjavascript:_e({}, 'cvml', 
 '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 javascript:_e({}, 'cvml',
 'clojure%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

Re: Overtone - Live @ Arnolfini

2012-08-07 Thread Roberto Mannai
On Tuesday, August 7, 2012, Sam Aaron wrote:


 On 7 Aug 2012, at 08:21, Roberto Mannai roberm...@gmail.comjavascript:;
 wrote:

  +1. The piano composition is reminescent of some Gurdjieff/De Hartmann
 music.

 The piano piece was composed by Erik Satie - I simply played my own
 interpretation of the timings on the monome. Sadly, you can't see that part
 on the video, but I was standing up and playing to the audience at that
 point. The source is part of the Overtone examples:


 https://github.com/overtone/overtone/blob/master/src/overtone/examples/monome/https://github.com/overtone/overtone/blob/master/src/overtone/examples/monome/satie.clj
 satie.cljhttps://github.com/overtone/overtone/blob/master/src/overtone/examples/monome/satie.clj


Interesting, I guess the monome is hooked by:
(def m (poly/init /dev/tty.usbserial-m64-0790))
And the incoming events by (poly/on-press... Etc



  I liked too the live coding gestures, where I track down your Emacs key
 bindings and your flowing among buffers. BTW, how did you update the values
 of that blue numerical sliders? By mouse?

 Aha! You're the first person to spot that! It's me essentially creating a
 new physical interface on-the-fly using my MIDI controller. Really, that's
 the part I'm most proud of - it involves quite an intimate relationship
 between Emacs Lisp and Clojure. It involves the following steps:

 * Emacs creates an overlay for the new value to be controlled
 * Emacs tells Clojure/Overtone to wait for the next MIDI control event,
 and to then continue to send new events for that specific controller back
 to Emacs
 * On new controller events, Emacs finds the specific form that the
 controlled value resides in, gets updates the value with the new incoming
 value from Overtone, and then finds the surrounding form and sends it back
 to Overtone to be evaluated.
 * Awesomeness ensues!


I even didn't suspect that Emacs would allow such graphical overlays,
have any link to doc?
Coming to the very exciting topic about interprocess comunication between
Emacs and a Midi controller I'll look forward to your code - I hope you'd
like give us at least a general overview of the architecture :)

Thank you
Roberto


 It'll soon be part of Emacs Live once I've ironed out the last few
 wrinkles so everyone can easily control Emacs/Clojure with a MIDI
 controller.

 Sam

 ---
 http://sam.aaron.name

*
*
*
*
*
*

-- 
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: Lambda: A lniux distro for clojurists

2012-05-29 Thread Roberto Mannai
+1, although maybe we are going OT.
With the derivate Lucid Puppy you can also reuse and install existing .deb
packages.

On Sunday, May 27, 2012, James Jeffries wrote:

 It might be worth looking into Puppy Linux. It is quite easy to make a
 derivative of of it and the community around it (forums, irc etc.) Is one
 of the friendliest I've found if you get stuck. In addition to this it is
 very small so ideal for running in a VM.

 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@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+unsubscr...@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 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: Lambda: A lniux distro for clojurists

2012-05-25 Thread Roberto Mannai
You could consider the SuseStudio online environment [1]. It allows simple
fine-graned package selections and different output formats (live CD, ISOs,
VMware / VirtualBox / KVM image, Amazon EC2 image).

[1] http://susestudio.com/
Examples: http://susestudio.com/browse

On Thu, May 24, 2012 at 10:11 PM, banseljaj ali.sajid.im...@gmail.comwrote:

 The distro should be able to:

- Connect to internet.
- Be able to convert itself into An VM/Iso/LiveCD etc
- Have all IDEs for Clojure installed and preconfigured.
   - Eclipse
   - Vim
   - Emacs
   - Netbeans
- Have a ready to play connection to clojure forums and channels
- Have at-least one book on clojure programming on board
- Have following clojure specific features
   - It should have leiningen installed and configured
   - It should have a local repo of all current clojure plugins
   - It should have a local cloud on which you can deploy web apps
   easily
   - it should have REPLlabs on baord and configured
- Have Clojure specific branding



 The packages that are needed absolutely:

- OpenJDK 1.7.0
- Leiningen
- Clojure
- Eclipse
- Vim
- Emacs 24
- Netbeans
- Emacs Starter kit
- CCW plugin for eclipse
- Firefox/Chrome
- A local webserver
- Postgresql
- LXDE/XFCE
- Gwibber/Other Social network Client
- xchat
- irssi
- git
- Regular packages for system functioning.


 I am still open to ideas. I intend to roll it as a complete distro, so I
 will love any and all input.

 For now, the specific things I need input for are:

- Who/How to create the art for branding.
- Any packages that are missing from the above listing.
- Any suggestions for the overall functioning.




-- 
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: How do I set jvm options for a lein repl

2012-05-21 Thread Roberto Mannai
You could add the following evinroment variable to your OS:
LEIN_JVM_OPTS=-Xms4G -Xmx4G

On Windows for example, you could add at the top of lein.bat file the
following line (under @echo off):
SET LEIN_JVM_OPTS=-Xms4G -Xmx4G

This should be enough to do the trick.


On Mon, May 21, 2012 at 6:51 AM, Larry Travis tra...@cs.wisc.edu wrote:

  How do I set jvm options for a *lein repl* initiated independently of a
 project?   In particular, I want the heap expansion that results from doing
 M-x clojure-jack-in in an emacs *project.clj* buffer with :jvm-opts [
 -Xms4G -Xmx4G] in its defproject form.
   --Larry

 --
 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: Clojure for shell scripts

2012-05-20 Thread Roberto Mannai
Maybe this experiment could interest you (clojurescript as a plugin of
gnome):
https://github.com/technomancy/lein-gnome

In general, if AFAIK the main performance issue is the jvm startup time and
the loading of the clojure.core library, one first solution could be
keeping a single background repl process active, which could run in
separated threads every shell script feed to it via a tcp socket. Every
thread should live in a isolated sandbox in order to keep clean the overall
environment.

On Sunday, May 20, 2012, Edward Ruggeri wrote:

 Hey everyone!,

 I know this is an old story.

 I've played with clojure, but the main thing that has kept me from
 never looking back is the startup speed.  Hello world! in Java takes
 me .303s, but just java -cp clojure-1.5.0-master-SNAPSHOT.jar takes
 1.989s (sending C-d to close the repl even before it starts).
 Searching around here, I've found -XX:+TieredCompilation knocks me
 down to 1.581s and also
 -Xbootclasspath/a:clojure-1.5.0-master-SNAPSHOT.jar all the way to
 0.938s.

 Incidentally, the same tricks with Hello World take me to 0.159s.

 Those were major improvements with very little cost; a huge win
 (thanks clojure list!).  Any further easy tips and tricks?  I'd like
 to get to the point where shell scripts aren't painful.  It looks like
 other major hints are nailgun, and never restarting the repl during
 development.

 I took the liberty of printing some System.getCurrentMillis from
 clojure.main.  It looks like it takes me 0.666s to enter the
 clojure.main main method, which I didn't entirely expect.  There are
 several static members of clojure.main that need to be initialized,
 these members take ~.520s to initialize in total; almost all of this
 is initializing `Var REQUIRE`.  Presumably this is when most of the
 clojure environment starts to get loaded?

 I'm just starting to look into clojure's jvm implementation; does
 anyone have some pointers on how to get quickly up to speed with the
 internals of clojure?

 Thanks!,

 -- Ned Ruggeri

 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@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+unsubscr...@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 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: [ANN] Clojure Namespace Browser (clj-ns-browser 1.0.0)

2012-05-19 Thread Roberto Mannai
I got the error:

*user=  (use 'clj-ns-browser.sdoc)
ClassNotFoundException com.fasterxml.jackson.core.JsonFactory*
java.net.URLClassLoader$1.run (URLClassLoader.java:366)

Should I add any jackson dependency? I followed these instructions on
Windows / lein 1.7:

;; Leiningen version 1
:dev-dependencies [[clj-ns-browser 1.2.0]]

$ lein deps
$ lein repl
user= (use 'clj-ns-browser.sdoc)


On Thu, May 17, 2012 at 3:34 AM, Andy Fingerhut andy.finger...@gmail.comwrote:

 Did you use the instructions under Install  Start-up on this page?

 https://github.com/franks42/clj-ns-browser

 Also, what OS are you using (and if Windows, are you using Cygwin, too?),
 and what do you get as output of the command lein version?

 Thanks,
 Andy

 On May 16, 2012, at 6:16 PM, thenwithexpandedwingshesteershisflight wrote:

  I get NoSuchMethodError
 org.apache.http.conn.ssl.SSLSocketFactory.init(Lorg/apache/http/conn/ssl/TrustStrategy;)V
  clj-http.core/fn--5014 (core.clj:64)

 --
 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: Clojure Bee iPhone app updated

2012-05-17 Thread Roberto Mannai
Looks interesting. Does it work off-line with local docs or require an
Internet connection?

BTW, do you know any Web Repl working on an iPhone or iPad? I tryied:
- http://tryclj.com/ (well, it works but does not support a copy/past
action)
- http://lotrepls.appspot.com/  (it requires a submit via CTRL+ENTER, but
the iPad does not have a CTRL button :) )

Thanks
Rob

On Thu, May 17, 2012 at 2:45 AM, mudphone kyle...@gmail.com wrote:

 Just a quick announcement that the Clojure Bee iPhone app was just
 updated.  This release eliminates crashiness and updates the font for
 the source code view.

 More info on the app here:

 http://itunes.apple.com/us/app/clojure-bee-api-documentation/id524862532?ls=1mt=8

 Anyone interested in a free copy, please email me directly (it's $1).
 I'm more than happy to give free copies to the Clojure community.

 Thanks!
 Kyle

 PS - It's called Clojure *Bee* because there is a quiz component, yet
 to be released (coming soon!).

 --
 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: How to configure a Clojure library at runtime?

2012-05-14 Thread Roberto Mannai
Instead of using alter-var-root you could use the binding form. On this
subject of factory methods you could find useful the following article,
expecially the with-implementation macro:

http://pragprog.com/magazines/2011-07/growing-a-dsl-with-clojure

IMHO that solution should not prevent the callers from instantiate
different implementations of the same generic API, even from the same
thread.

Cheers,
Roberto


On Sat, May 12, 2012 at 2:49 PM, James Thornton james.thorn...@gmail.comwrote:


 On Saturday, May 12, 2012 12:44:45 AM UTC-5, Baishampayan Ghose wrote:


 There are many ways of doing this. One approach that I have seen a lot
 is something like this -

 ;; core.clj

 (def ^:dynamic *settings* {:default :stuff}) ;; the default settings can
 be nil


 I was experimenting with the dynamic varr approach...

 ;; bulbs/neo4jserver/client.clj

 (def ^:dynamic *config* default-config)

 (defn set-config!
   [config]
   (alter-var-root #'*config* (fn [_] (merge default-config config

 (defn neo4j-client
   [ config]
   (set-config! (first config)))

 (neo4j-client {:root_uri http://localhost:7474/data/db/})

 (println *config*)


 ...but Andrew Cooke pointed out that using a global var would preclude you
 from being able to use multiple, independent graph instances in your
 program, whereas you can in the Python version (
 http://stackoverflow.com/questions/10540999/how-to-configure-a-clojure-library-at-runtime
 ).



-- 
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: new with clojure, need help!

2012-05-06 Thread Roberto Mannai
If you're also planning to try Emacs:
http://sourceforge.net/apps/wordpress/codesounding/2012/04/14/installing-and-configuring-emacs-24-for-clojure-updated/

Key bindings (under SLIME commands):
https://github.com/technomancy/swank-clojure

On Wed, Apr 25, 2012 at 4:37 PM, omer omeryco...@gmail.com wrote:

 [...] i need a more basic guidence on how to install the nessecery plugins
 to eclipse, and what to do with them...

 --
 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: Why doesn't doc work in clojure-jack-in slime-repl?

2012-05-04 Thread Roberto Mannai
You should use it:

user (use 'clojure.repl)
nil
user (doc doc)
...


On Fri, May 4, 2012 at 9:27 PM, Larry Travis tra...@cs.wisc.edu wrote:

 A command like

 user (doc hash-map)

 in the slime-repl created by clojure-jack-in

 results in

 Unable to resolve symbol: doc in this context
  [Thrown class java.lang.RuntimeException]

 Can this be fixed or do I have to do my doc requests someplace else?

  --Larry


 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscribe@**googlegroups.comclojure%2bunsubscr...@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 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: Why doesn't doc work in clojure-jack-in slime-repl?

2012-05-04 Thread Roberto Mannai
If you are studying the doc maybe you could find useful this bunch of
scripts: http://pastebin.com/cXL1wNVC
They are an updated version of what posted here:
http://www.learningclojure.com/2010/03/conditioning-repl.html

On Fri, May 4, 2012 at 9:44 PM, Larry Travis tra...@cs.wisc.edu wrote:

  Thank you, Roberto.  Works like a charm.
   --Larry


 On 5/4/12 2:32 PM, Roberto Mannai wrote:

 You should use it:

 user (use 'clojure.repl)
 nil
 user (doc doc)
 ...


 On Fri, May 4, 2012 at 9:27 PM, Larry Travis tra...@cs.wisc.edu wrote:

 A command like

 user (doc hash-map)

 in the slime-repl created by clojure-jack-in

 results in

 Unable to resolve symbol: doc in this context
  [Thrown class java.lang.RuntimeException]

 Can this be fixed or do I have to do my doc requests someplace else?

  --Larry


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


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


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


-- 
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: How does this code works.

2012-04-15 Thread Roberto Mannai
if (n == 0) return the factorial, else go to the loop label and recur
with the two parameters (n--)  and (factorial * n). Go on until n-- reaches
0.

In a Java-like translation we could have:

int n = number;
factorial = 1;

while(n  0){
   factorial *= n--;
}
return factorial;



On Sun, Apr 15, 2012 at 5:37 PM, Anto anto.aravinth@gmail.com wrote:

 Can anyone explain me what does the last three lines
 does:

  (loop [n number factorial 1]
(if (zero? n)
  factorial (recur (dec n) (* factorial n

 Thanks in advance.

 --
 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: [OT] Any other italian Clojure users?

2012-03-26 Thread Roberto Mannai
Hi Marco,

here another user (really a student), although I'm out-of-sync with
Clojure since a couple of months.
Why do not create also an Italian Clojure Linkedin group?

Ciao,
Roberto

On Thu, Mar 22, 2012 at 10:21 AM, Marco Dalla Stella 
m.dallaste...@gmail.com wrote:

 Hi,

 I just want to know if there are any other italian Clojure users in
 the ml, maybe for open an Italian Clojure User Group and organize some
 meetings...

 Thanks,
 --
 Marco Dalla Stella
 web: http://thediracsea.org
 twitter: http://twitter.com/kra1iz3c

 --
 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: Setting up Emacs to edit Clojure for Windows folks

2012-01-25 Thread Roberto Mannai
My notes about installing Emacs 24 on Windows 7, with clojure support:
http://sourceforge.net/apps/wordpress/codesounding/2011/09/29/installing-emacs-24-and-clojure-mode-on-windows-7-step-by-step/

On Wed, Jan 25, 2012 at 11:40 PM, Sean Corfield seancorfi...@gmail.comwrote:


 http://corfield.org/articles/emacs_win.html

 But whilst it worked on XP, various folks could not get it to work on
 Win7 so I never turned it into a formal blog post...
 --
 Sean A Corfield -- (904) 302-SEAN
 An Architect's View -- http://corfield.org/
 World Singles, LLC. -- http://worldsingles.com/

 Perfection is the enemy of the good.
 -- Gustave Flaubert, French realist novelist (1821-1880)

 --
 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: Can't build clojure cloned from github - 2 tests failed - when running from cygwin

2011-11-22 Thread Roberto Mannai
The classpath option -cp is not handling correctly the spaces. I'd
suggest you to not have spaces in the Windows's paths.

Install Java not in c:\Program Files, but for example in c:\develop\Java6

On Tue, Nov 22, 2011 at 10:04 AM, Michael Jaaka
michael.ja...@googlemail.com wrote:
 Here is too a problem with building proper path, after M-x clojure-
 jack-in I got in buffer


 Debugger entered--Lisp error: (error Could not start swank server:
 java.lang.NoClassDefFoundError: Files\\Java\\jre6\\lib\\ext\\QTJava/
 zip;\;;test;src;C:\\Java\\/lein\\self-installs\\leiningen-1/6/0-
 standalone/jar
 Caused by: java.lang.ClassNotFoundException: Files\\Java\\jre6\\lib\
 \ext\\QTJava.zip;\;;test;src;C:\\Java\\.lein\\self-installs\
 \leiningen-1.6.0-standalone.jar
        at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
 Could not find the main class: Files\\Java\\jre6\\lib\\ext\\QTJava.zip;
 \;;test;src;C:\\Java\\.lein\\self-installs\\leiningen-1.6.0-
 standalone.jar.  Program will exit.
 Exception in thread \main\ )
  signal(error (Could not start swank server:
 java.lang.NoClassDefFoundError: Files\\Java\\jre6\\lib\\ext\\QTJava/
 zip;\;;test;src;C:\\Java\\/lein\\self-installs\\leiningen-1/6/0-
 standalone/jar\nCaused by: java.lang.ClassNotFoundException: Files\
 \Java\\jre6\\lib\\ext\\QTJava.zip;\;;test;src;C:\\Java\\.lein\\self-
 installs\\leiningen-1.6.0-standalone.jar\n      at java.net.URLClassLoader
 $1.run(URLClassLoader.java:202)\n       at
 java.security.AccessController.doPrivileged(Native Method)\n    at
 java.net.URLClassLoader.findClass(URLClassLoader.java:190)\n    at
 java.lang.ClassLoader.loadClass(ClassLoader.java:306)\n at
 sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)\n at
 java.lang.ClassLoader.loadClass(ClassLoader.java:247)\nCould not find
 the main class: Files\\Java\\jre6\\lib\\ext\\QTJava.zip;\;;test;src;C:
 \\Java\\.lein\\self-installs\\leiningen-1.6.0-standalone.jar.  Program
 will exit.\nException in thread \main\ ))
  error(Could not start swank server: %s
 java.lang.NoClassDefFoundError: Files\\Java\\jre6\\lib\\ext\\QTJava/
 zip;\;;test;src;C:\\Java\\/lein\\self-installs\\leiningen-1/6/0-
 standalone/jar\nCaused by: java.lang.ClassNotFoundException: Files\
 \Java\\jre6\\lib\\ext\\QTJava.zip;\;;test;src;C:\\Java\\.lein\\self-
 installs\\leiningen-1.6.0-standalone.jar\n      at java.net.URLClassLoader
 $1.run(URLClassLoader.java:202)\n       at
 java.security.AccessController.doPrivileged(Native Method)\n    at
 java.net.URLClassLoader.findClass(URLClassLoader.java:190)\n    at
 java.lang.ClassLoader.loadClass(ClassLoader.java:306)\n at
 sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)\n at
 java.lang.ClassLoader.loadClass(ClassLoader.java:247)\nCould not find
 the main class: Files\\Java\\jre6\\lib\\ext\\QTJava.zip;\;;test;src;C:
 \\Java\\.lein\\self-installs\\leiningen-1.6.0-standalone.jar.  Program
 will exit.\nException in thread \main\ )
  clojure-jack-in-sentinel(#process swank finished\n)




 On Nov 22, 8:55 am, Roberto Mannai roberm...@gmail.com wrote:
 If you're having problems with cygwin, you could use Emacs/lein without 
 it:http://sourceforge.net/apps/wordpress/codesounding/2011/09/29/install...

 On Tue, Nov 22, 2011 at 8:24 AM, Michael Jaaka







 michael.ja...@googlemail.com wrote:
  Well, in plugins i had 1.3.3 but in project/dev had 1.2.1 and 1.3.3 so
  I deleted the 1.2.1.
  Then tried again to jack-in and got something like this:

  error in process filter: Opening input file: no such file or
  directory, /home/mjaaka/tmp/test-project/src/test_project/C:Documents
  and Settings^Gmjaaka/.emacs.d/swank/slime-cdf283b4.el

  So there is a problem with building absolute path on cygwin (by
  swank?).

  My .emacs.d is located at C:\cygwin\home\mjaaka\.emacs.d and there is
  no /swank/slime-cdf283b4.el
  The nearest silme.el is located at C:\cygwin\home\mjaaka\.emacs.d\elpa
  \slime-20100404.1\slime.el
  Beside this in elpa I have clojure-mode-1.11.4, clojure-project-
  mode-1.0, clojurescript-mode-0.5, levenshtein-1.0, project-mode-1.0.

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

Re: Can't build clojure cloned from github - 2 tests failed - when running from cygwin

2011-11-21 Thread Roberto Mannai
If you're having problems with cygwin, you could use Emacs/lein without it:
http://sourceforge.net/apps/wordpress/codesounding/2011/09/29/installing-emacs-24-and-clojure-mode-on-windows-7-step-by-step/

On Tue, Nov 22, 2011 at 8:24 AM, Michael Jaaka
michael.ja...@googlemail.com wrote:
 Well, in plugins i had 1.3.3 but in project/dev had 1.2.1 and 1.3.3 so
 I deleted the 1.2.1.
 Then tried again to jack-in and got something like this:

 error in process filter: Opening input file: no such file or
 directory, /home/mjaaka/tmp/test-project/src/test_project/C:Documents
 and Settings^Gmjaaka/.emacs.d/swank/slime-cdf283b4.el

 So there is a problem with building absolute path on cygwin (by
 swank?).

 My .emacs.d is located at C:\cygwin\home\mjaaka\.emacs.d and there is
 no /swank/slime-cdf283b4.el
 The nearest silme.el is located at C:\cygwin\home\mjaaka\.emacs.d\elpa
 \slime-20100404.1\slime.el
 Beside this in elpa I have clojure-mode-1.11.4, clojure-project-
 mode-1.0, clojurescript-mode-0.5, levenshtein-1.0, project-mode-1.0.



-- 
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: Literate Programming example

2011-11-20 Thread Roberto Mannai
FYI: some time ago the Opensuse project used such a collaborative tool
(http://www.co-ment.com) in order to get a shared mindset of its
goals.
This was the result, see how clicking on higlight words points to
their comments:
https://lite.co-ment.com/text/lNPCgzeGHdV/view/

On Sat, Nov 19, 2011 at 10:21 PM, Daniel Jomphe danieljom...@gmail.com wrote:
 With the tools available to us today, there's no reason why we at least
 shouldn't have everything needed to make literate programming more seamless,
 more natural. For example, while reading your toy example, I found myself
 wanting to ask a question or comment on your thoughts a few times. If your
 book had been displayed on a dynamic website geared towards literate
 programming, I might have been able to click on a paragraph and write my
 question/comment right there. And then, after a short conversation there,
 you would have integrated the fruits of our conversation directly into the
 end result. Thus each new reader would have been an occasion to improve the
 book. ...It's nothing surprising since this kind of review system already
 exists in some publishers' toolkits.

-- 
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: aquamacs, slime and clojure on OS X

2011-10-24 Thread Roberto Mannai
Confirm, as Jake said it is enough to delete the folder
/Library/Application Support/Aquamacs Emacs/SLIME/; my problem was
probably derived from having previously installed also
Aquamacs-SLIME-2011-xxx.pkg.tgz, the SLIME plugin from
http://aquamacs.org/download.shtml.

(Lein's swank plugin uses an embedded slime.el - check
swank-clojure-1.4.0-SNAPSHOT.jar\swank\payload)

On Mon, Sep 26, 2011 at 2:56 AM, Roberto Mannai roberm...@gmail.com wrote:

 I have some trouble. I'm on OSX Lion, and have a few hours ago
 installed Aquamacs and SLIME from http://aquamacs.org/download.shtml.
 Then installed lein/swank/and clojure-mode, as Phil suggested.

 In order to make it work I had to remove the autodoc option, by
 commenting line 20 from /Library/Application Support/Aquamacs
 Emacs/SLIME/contrib/slime-fancy.el:
 ;(slime-autodoc-init)

 So by starting swank manually with lein swank (or swank-clojure) +
 M-x slime-connect I can now evaluate Clojure code in the REPL; instead
 when doing a clojure-jack-in I get the following error:

 (from *Messages* buffer)
  Starting swank server...
  error in process filter: progn: Invalid read syntax: )
  error in process filter: Invalid read syntax: )

 (last lines from *swank* buffer)
  (provide 'slime-repl)
  ;;; slime-repl.el ends here
  (run-hooks 'slime-load-hook)

 Any idea?

 On Sun, Sep 25, 2011 at 5:52 PM, László Török ltoro...@gmail.com wrote:
  +1 for me too on Snow Leopard with latest Aquamacs
 
  2011/9/23 Durgesh Mankekar durg...@gmail.com
 
  +1 here. These instructions have worked for me with Aquamacs.
  On Sep 23, 2011, at 2:46 PM, Justin Kramer wrote:
 
    * install Leiningen
    * install the swank-clojure plugin: lein plugin install swank-clojure
  1.3.2
    * install clojure-mode (you can do this from git)
    * navigate to a project and do M-x clojure-jack-in
 
  That's all it takes. It might work with Aquamacs, but since that fork
  is not portable it's impossible for me to test on it. So GNU Emacs is
  recommended.
 
  For what it's worth, I use this setup with Aquamacs and everything works
  perfectly.
  Justin
  --
  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
 
 
  --
  László Török
  Skype: laczoka2000
  Twitter: @laczoka
 
  --
  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: trouble setting up emacs

2011-10-24 Thread Roberto Mannai
It seems you're having some problems with incompatible slime versions.
On Mac I'm successfully using Acquamacs
(http://aquamacs.org/download.shtml - do NOT install
Aquamacs-SLIME-xx.pkg.tgz) without any particular workaround. Just
install it, install lein (my script is /usr/bin/lein) and the
clojure-mode. See also
http://groups.google.com/group/clojure/browse_thread/thread/986227536292502b?hl=en

On Tue, Oct 25, 2011 at 2:06 AM, Howard Lewis Ship hls...@gmail.com wrote:
 So Swank appears to be running, but when I edit a Clojure file and hit
 C-x C-e I get an error:

 Symbol's function definition is void: lisp-eval-last-sexp

 I also see this in my *messages* buffer:

 error in process filter: require: Symbol's value as variable is void: 
 slime-clj

 Any ideas ... even on where to start?



 On Mon, Oct 24, 2011 at 4:55 PM, Howard Lewis Ship hls...@gmail.com wrote:
 This was helpful:

 http://www.emacswiki.org/emacs/MacOSTweaks#toc14

 I added the following to my init.el:

 (setenv PATH (concat (getenv PATH) :~/bin))
 (setq exec-path (append exec-path `(~/bin)))


 Seems like I could have used (add-to-list 'exec-path ~/bin) for the
 second line, is that right?

 In any case, my next step is to see if Swank is working (it would help
 if I knew what Swank was supposed to do!)

 On Mon, Oct 24, 2011 at 4:33 PM, Phil Hagelberg p...@hagelb.org wrote:
 On Mon, Oct 24, 2011 at 4:28 PM, Howard Lewis Ship hls...@gmail.com wrote:
 lein is on my search path (in ~/bin).  Where do I update things so
 that it is on the path for the Swank process?

 In Mac OS X, usually programs that are launched from the GUI don't get
 their environment variables (like $PATH) set correctly. Supposedly
 there's a fix, but it involves editing a file called plist.xml, so I
 have a hard time recommending it with a clear conscience.

 -Phil

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



 --
 Howard M. Lewis Ship

 Creator of Apache Tapestry

 The source for Tapestry training, mentoring and support. Contact me to
 learn how I can get you up and productive in Tapestry fast!

 (971) 678-5210
 http://howardlewisship.com




 --
 Howard M. Lewis Ship

 Creator of Apache Tapestry

 The source for Tapestry training, mentoring and support. Contact me to
 learn how I can get you up and productive in Tapestry fast!

 (971) 678-5210
 http://howardlewisship.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

-- 
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: aquamacs, slime and clojure on OS X

2011-09-25 Thread Roberto Mannai
I have some trouble. I'm on OSX Lion, and have a few hours ago
installed Aquamacs and SLIME from http://aquamacs.org/download.shtml.
Then installed lein/swank/and clojure-mode, as Phil suggested.

In order to make it work I had to remove the autodoc option, by
commenting line 20 from /Library/Application Support/Aquamacs
Emacs/SLIME/contrib/slime-fancy.el:
;(slime-autodoc-init)

So by starting swank manually with lein swank (or swank-clojure) +
M-x slime-connect I can now evaluate Clojure code in the REPL; instead
when doing a clojure-jack-in I get the following error:

(from *Messages* buffer)
 Starting swank server...
 error in process filter: progn: Invalid read syntax: )
 error in process filter: Invalid read syntax: )

(last lines from *swank* buffer)
 (provide 'slime-repl)
 ;;; slime-repl.el ends here
 (run-hooks 'slime-load-hook)

Any idea?

On Sun, Sep 25, 2011 at 5:52 PM, László Török ltoro...@gmail.com wrote:
 +1 for me too on Snow Leopard with latest Aquamacs

 2011/9/23 Durgesh Mankekar durg...@gmail.com

 +1 here. These instructions have worked for me with Aquamacs.
 On Sep 23, 2011, at 2:46 PM, Justin Kramer wrote:

   * install Leiningen
   * install the swank-clojure plugin: lein plugin install swank-clojure
 1.3.2
   * install clojure-mode (you can do this from git)
   * navigate to a project and do M-x clojure-jack-in

 That's all it takes. It might work with Aquamacs, but since that fork
 is not portable it's impossible for me to test on it. So GNU Emacs is
 recommended.

 For what it's worth, I use this setup with Aquamacs and everything works
 perfectly.
 Justin
 --
 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


 --
 László Török
 Skype: laczoka2000
 Twitter: @laczoka

 --
 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: ClojureBox on Window 7: classpath in .emacs file not working

2011-09-17 Thread Roberto Mannai
Update: setting manually an environment variable named HOME, you can
choose where clojurebox/emacs will search your .emacs file.

On Thu, Sep 15, 2011 at 9:13 PM, Roberto Mannai roberm...@gmail.com wrote:
 Hi rsgoheen,

 Here how I'm now able to work with Clojurebox on Windows 7. Perhaps
 mine it isn't exactly the same as yours but can give some hints.

 After some process sniffing, I found that Emacs was searching the
 .emacs file under C:\, so I created it.
 In order to create it, you have to do it in DOS (the WIN Explorer
 doesn't allow you to make dotted files), furthermore acting as an
 Administrator.

 So: open the DOS console as an Administrator and type:
 C:\Windows\system32echo  c:\.emacs

 Now you can open it with Notepad (again, as an Administrator) and type
 your classpath configuration:
 C:\Windows\system32notepad c:\.emacs

 After adding the (setq swank-clojure-classpath ...  stuff, saving
 the file and restarting Clojurebox, you should be able to require/use
 the new classpath .clj files.

 Hope this help, ciao.

 On Fri, Jun 10, 2011 at 4:37 PM, rsgoheen goh...@gmail.com wrote:
 This is absolutely killing me.  I'm starting to use ClojureBox to
 further my knowledge of Clojure, and I can't get it to pick up the
 individual *.clj files I'm working with or the example code from
 Halloway's book.  There's lots of good information on line telling me
 how to set up my .emacs file, and none of it seems to work for me.
 I'm running on Windows 7, and here are the details:

 My .emacs (created through C-x C-f ./.emacs) looks like this
 ---
 (setq swank-clojure-extra-classpaths '())
 (add-to-list 'swank-clojure-extra-classpaths C:/Work/schloj-code)

 (tool-bar-mode -1)
 ---
 I know it's reading correctly, because the last line is turning the
 toolbar off when emacs is started

 I've unzipped the sample files from Halloway's books to the C:\work
 \schloj-code\ location, and there is a subfolder called examples,
 and a file in there called introduction.clj

 When I go to the REPL and type in:

 (using 'examples.introduction)

 I get the following file-not-found exception stack:
 ---
 Could not locate examples/introduction__init.class or examples/
 introduction.clj on classpath:
  [Thrown class java.io.FileNotFoundException]

 Restarts:
  0: [QUIT] Quit to the SLIME top level

 Backtrace:
  0: clojure.lang.RT.load(RT.java:412)
  1: clojure.lang.RT.load(RT.java:381)
  2: clojure.core$load$fn__4511.invoke(core.clj:4905)
  3: clojure.core$load.doInvoke(core.clj:4904)
  4: clojure.lang.RestFn.invoke(RestFn.java:409)

 ---

 How do I figure out what I might be doing wrong?  Is there any way to
 tell where the REPL is looking for this file to know it's looking in
 the correct place?  Is there a Windows or Windows 7 gotcha here that
 I'm missing (case sensitivity? permissions denied?)

 Please, this is making me nuts



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


Clojure Speed performance test

2011-08-18 Thread Roberto Mannai
Hello,
I recently stumbled upon this page:
http://java.dzone.com/articles/contrasting-performance
They are comparing several languages (Java, Scala, Python, Erlang,
Clojure, Ruby, Groovy, Javascript), and Clojure rated very badly:

 Object Oriented  List Reduction
Element Recursion
Java 1.6 0.6371.435   
2.816
Clojure 1.2.1 -   25.966 28.753

Maybe the clojure's scripts were not very idiomatic? If some guru
wants to check them, here's the source code:
 - https://github.com/dnene/josephus/blob/master/element-recursion/josephus.clj
-  https://github.com/dnene/josephus/blob/master/list-reduction/josephus.clj

All the best,
Roberto

-- 
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: Standard Practice for a Canned Lexer, Parser, Analyzer?

2010-01-30 Thread Roberto Mannai
I should not go with an automatic parser. Binary network protocols can
mean a broad range of things :). If there is just a passive consumer
(like a textual HTTP browser), you could consume all the binary data
and then parse it, though I don't know if do exist a grammar for
binary symbols (just found this: http://www.iwriteiam.nl/Ha_BFF.html).
You likely are consuming a real time stream, so the binary data is the
actual content, not a structured message.

In general, high level network protocols are text-based: HTTP, telnet,
POP, SMTP. There is some trick:
- you can send binary attachments with SMTP or consume them via HTTP
because they are encoded in a textual description (BASE64);
- the FTP protocol is two-faced: the interactive command controls are
sent via a textual protocol, whereas the binary data is sent in a
binary stream (in a new TCP port).

Low level protocols (TCP or IP) are binary protocols. The packets have
a format (http://www.faqs.org/rfcs/rfc793.html) which can be quickly
checked in a numeric way, not in a symbolic way. The check is not just
on the format, but also on the content, via checksum redundancy
bits. Just a parsing is not enough.


On Sat, Jan 30, 2010 at 7:49 AM, Michael Wood esiot...@gmail.com wrote:
 How about for things like binary network protocols?  Would you treat
 them the same way as e.g. source code for a language?  Obviously
 there's no code generation, but you still need to parse it.

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


Re: Standard Practice for a Canned Lexer, Parser, Analyzer?

2010-01-30 Thread Roberto Mannai
On Sat, Jan 30, 2010 at 1:04 PM, Alex Osborne a...@meshy.org wrote:
 there *are* binary protocol parser generators.  An
 example would be Google protocol buffers:

 http://code.google.com/p/protobuf/

Very interesting, thank you

-- 
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: Standard Practice for a Canned Lexer, Parser, Analyzer?

2010-01-30 Thread Roberto Mannai
On Sat, Jan 30, 2010 at 1:04 PM, Michael Wood esiot...@gmail.com wrote:

 I have come across references to a declarative implementation of the
 DICOM-3 network protocol written in Common Lisp and I was wondering
 what that means, exactly, and how one would go about doing something
 for an arbitrary network protocol.

Maybe you're referring to this document:
http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.106.982rep=rep1type=pdf

I didn't know this (medical) protocol. Anyway, its parsing is driven
by some header control data:

To the PDU parser, this message is simply an uninterpreted stream of
bytes. The DICOM Upper-Layer protocol specifies a header for  each
message encoding the length of the following data field and some flags
indicating whether the data field is a command message or a data
object (and additionally whether the data field contains the complete
object or is
a portion of a long data field that has been fragmented into multiple
messages).
If the message is a command, our system gives the PDU parser pointers
to the beginning and end (in the TCP data buffer) of the message. The
ruleset contains rules for parsing commands using the same conventions
and language as for parsing any other type of PDU.
If the message is a data object, however, the buffer (and begin/end
pointers) are passed to a different parser. This parser is also
data-driven, using the data dictionary to decode arbitrary data
objects.

Each server/client has a state machine which processes those messages:
it can guess what to do next by reading the header control data:

The Prism DICOM code uses a finite state machine to implement the DICOM Upper
Layer Protocol, parsing incoming PDUs, and generating outgoing PDUs
using a production rule grammar

As the system parses incoming PDUs it extends an environment which
stores these variables and their values. The environment is accessible
to any operation that
needs values of data fields in the decoded PDUs. In Lisp terms, the
environment is represented as a nested association list. That is, the
entire environment is a list of
components.

It seems to me that there is no automatic parser generation from a
grammar: there is a continuous consuming and parsing which check the
data with the stored grammar, and after a recognized event it changes
the machine's state, producing a proper output.

Anyway, very interesting this LISP implementation, thank you. Never
heard of such a 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: Standard Practice for a Canned Lexer, Parser, Analyzer?

2010-01-29 Thread Roberto Mannai
Hello Liam
I'm neither an expert on this subject. :) Nevertheless I'll give you
my position.

Defining a new language, formally speaking, is very hard: you have to
define new symbols and rules. On many languages the same token can be
used in different contexts (think of { on Java: if blocks, method
blocks, class blocks: here the word block means very different
things). If you're going to write by hand you'll have to check all
these contextual points, and finally handle the validation process of
the source file as a whole.

Tools as ANTLR give you the chance to just specify the grammar
(allowed symbols and rules), leaving to them all the validation
checks. You can also give them a grammar and a set of events (called
template in ANTLR), which are automatically triggered by the parser
when it processes a given rule.

So this is the reason, in my opinion, of why the by hand way is not
very used. This topic is related to (external) Domain Specific
Languages, so maybe you can find interesting this:
http://martinfowler.com/articles/codeGenDsl.html#UsingTemplatesForGeneration.

Ciao
Roberto


On Fri, Jan 29, 2010 at 4:59 AM, Liam liam.ga...@gmail.com wrote:
 Could someone educate me about what developers normally do when faced
 with having to create a lexer / parser / analyzer, say for clojure?

 Why would people go with a canned solution, i.e. ready-made like soup
 out of a can, instead of by hand?

 E.g. why did the Counterclockwise Eclipse plug-in for Clojure use
 ANTLR , or why did in the Enclojure NetBeans plug-in for clojure use
 JFLEX? Why in clojure itself is there a reader made by hand and not
 using a canned generator?

 Am I naive in thinking one should do that by hand? Is this archaic
 thinking like those who still prefer building websites in HTML by
 hand?

 What's the advantage of doing that, say for clojure or in general? You
 still have to learn how a given generator works. And you may be
 limited by its design. What if you want fine combed control over how
 things are parsed to get, for example, sophisticated syntax based
 evaluation or inferences from cold code. E.g. like what Eclipse does
 for Java and their “Java Models” and exhaustive “Abstract Syntax Tree”
 nodes?

 I hope some of you could be generous enough to enlighten 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

-- 
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: Standard Practice for a Canned Lexer, Parser, Analyzer?

2010-01-29 Thread Roberto Mannai
I mean, the whole article: http://martinfowler.com/articles/codeGenDsl.html

 http://martinfowler.com/articles/codeGenDsl.html#UsingTemplatesForGeneration.

-- 
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: reading a range from a large file

2009-10-27 Thread Roberto Mannai
setLineNumber should not skip lines (at least officially - see
http://java.sun.com/j2se/1.4.2/docs/api/java/io/LineNumberReader.html).

If every line is of fixed size, in Java you could use a RandomAccessFile.

On Sun, Oct 25, 2009 at 3:30 AM, tommy c wheels...@gmail.com wrote:


 I have a huge file(900MB) that I would like to read/process in
 chunks.

 In clojure, i can grab the first n lines nicely:
 (with-open [r (reader FILE)]  (str-join ,  (take n (line-seq r

 How can i grab the first n lines starting from an line offset? ex,
 grab lines 5 to 10 rather than just the first 5.

 I can do this in java using traditional java way by using
 LineNumberReader's setLineNumber(int lineNumber)  but i'm not sure how
 to interweave this in with clojure's file sequence operations.

 


--~--~-~--~~~---~--~~
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: Anyone care to defend/comment some points in this presentation

2009-09-18 Thread Roberto Mannai
Also the slide 21 should worth an answer: a benchmark of STM with more CPU
gives Performance died – choked in the STM

On Fri, Sep 18, 2009 at 9:22 AM, Michael Wood esiot...@gmail.com wrote:


 2009/9/17 z5h bolusm...@gmail.com:
 
  Specifically some problems encountered in Clojure's STM and bytecode
  generation.
 
 
 http://www.azulsystems.com/events/javaone_2009/session/2009_J1_JVMLang.pdf
  (Slide's 8 and 20-21)

 I suppose you mean slide 9 rather than 8:

  Clojure - “almost close”
  * Good: no obvious subroutine calls in inner loop
  * Bad: Massive “ephemeral” object allocation - requires good GC
  * But needs Escape Analysis to go really fast
  * Ugly: fix-num overflow checks everywhere
  * Turn off fix-nums: same speed as Java
  * Weird “holes” -
  * Not-optimized reflection calls here  there
  * Can get reports on generated reflection calls

 Just mentioning that since nobody's commented on it yet.

 --
 Michael Wood esiot...@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
-~--~~~~--~~--~--~---