Re: ClojureCLR: change in naming/location of AOT-compiled assemblies

2011-02-03 Thread eyeris
On Feb 3, 12:07 am, dmiller dmiller2...@gmail.com wrote:
 Completely arbitrarily, ClojureCLR names the AOT-compilation generated
 files whatever.clj.dll.  The .clj.  is superfluous, but does serve as
 a visual indication of the assembly's origin.   Question:  Useful, or
 just annoying?

The extra .clj in the .dll filename can be annoying while doing TAB-
based filename completion. That alone isn't enough of a reason to
change it though.

-- 
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: Deflayout - define Swing UI declaratively

2011-02-03 Thread eyeris
If you only intend to support border and flow layouts, you could
reduce the verbosity by maps implying border layout and vectors
implying flow layouts. That approach would limit you to simpler
layouts, but your example would become something like this:

(deflayout frame
  {:west gamepanel
   :east (deflayout sidepanel
 [nextpanel (JButton. Exit)] :flow :trailing))


On Feb 2, 12:43 pm, Alexander Yakushev yakushev.a...@gmail.com
wrote:
 Since defining the UI in Clojure is pretty tedious process, even with
 all nice interop features, I decided to write a small library to do
 this more easily and in a declarative way. I was inspired by a series
 of blogposts by Stuart Sierra, he wrote a wonderful macro that deals
 with GridBagLayout. But often you don't need that complex layout, any
 simpler layout will do. So I spent an evening writing 
 thishttps://github.com/alexander-yakushev/deflayout.
 Currently only BorderLayout and FlowLayout are supported, but layouts
 can be added easily. I wanted somebody to look at the code and give
 the opinion about what can be done better and what changes can be
 made.
 Usage of the lib is very easy. Here is an example from my tetris game:

 (deflayout
     frame (:border)
     :WEST gamepanel
     :EAST (deflayout
                 sidepanel (:flow :TRAILING)
                 nextpanel
                 (JButton. Exit)))

 In this example we define, that the frame will use BorderLayout and
 add two panels - one on the west side, and second one on the east one.
 Sidepanel that we add is the macro call itself, with FlowLayout and
 two elements added - another panel and a button.
 As you see, the macro executes the code differently based on which
 layout is used. Thus, when the BorderLayout is used, arguments are
 read by pairs where the first argument is position and the second is
 the object. Instead, in FlowLayout all objects are just passed
 sequentially.
 I will surely extend this macro to cover all other layouts, but I need
 some of the guidance and recommendations. Also, I would be happy if
 Stuart Sierra allowed me to include his GridBagLayout code into the
 lib.

-- 
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: vsClojure Release

2011-01-06 Thread eyeris
Thank you for working on this! I wanted to create an extension with
just syntax highlighting and AOT compilation but I gave up while
reading through the VS extension API. Your patience must be never-
ending to use that API :) I will download and test this later today.



On Dec 30 2010, 10:30 pm, jmis jmis@gmail.com wrote:
 The first release ofvsClojureis now available in the Visual Studio
 Gallery.  You can download it using the extension manager in Visual
 Studio 2010 and searching for vsClojure.  There should be no manual
 setup and the extension will work with the Visual Studio 2010 Shell.

 This release focused on implementing basic features, laying the
 plumbing for more advanced features and creating a packaging
 strategy.  For a complete list of features please 
 visithttp://github.com/jmis/vsClojure.

 Future releases depend on your feedback.  Feel free to open issues in
 the issue tracker or post suggestions in the discussion group 
 athttp://groups.google.com/group/vsclojure-extension.

 Thanks,
 jmis

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


Re: Is ClojureCLR converging toward a release?

2010-10-13 Thread eyeris
Thank you for all the work you've put into this!


On Oct 11, 5:39 pm, dmiller dmiller2...@gmail.com wrote:
 Check out the downloads area onhttp://github.com/richhickey/clojure-clr.
 Grabclojure-clr-1.2.0.zip.  Unzip, start up Clojure.Main.exe and you
 should be running.  The zip also contains Clojure.Compile.exe, which
 you can invoke with command line arguments indicating files to
 compile.  The support DLLs for the DLR are included.  These are debug
 builds for .Net 3.5 only.

 Within the next day or so, the master branch will updated with a new
 build process that will create debug and release builds for 3.5 and
 4.0.  Futurebinarydistributions will be available in all four
 flavors.

 The new build process and extension to .Net 4.0  requires 
 theClojureCLRproject to move to Visual Studio 2010.  It will simplify
 getting started for developers, too.   It's ready to go.  I just have
 to get the wiki pages updated.

 -David

 On Oct 4, 11:13 pm, Mike K mbk.li...@gmail.com wrote:

  David, Rich: any further updates on this?

     Mike

  On Sep 24, 8:24 am, dmiller dmiller2...@gmail.com wrote:

    Just waiting for that person's CA to be processed by Rich.

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

2010-09-25 Thread eyeris
This sounds fantastic! Integrating the (doc) function with the F1 help
system in some way would be helpful.


On Sep 23, 3:20 pm, Will Kennedy parset...@gmail.com wrote:
 Some background: I've been spending some of my free time providing by
 basic Clojure support in VS 2010. To be honest, I'm a bit of a Clojure
 newbie, so I figured something that would require me to build a lexer
 and parser for the language and delve into the clojure source would be
 a great way to learn while creating something other people might find
 valuable. For adoption, having first-class support in VS for clojure-
 clr would be huge.

 I've built syntax highlighting, brace matching, and some basic
 formatting helpers. I'm working on the REPL window and project/build
 system next. My hope is to get it to the point where a user can
 download the plugin, create a new project, get some basic boilerplate,
 build, execute and debug all from within Visual Studio. People who are
 using emacs won't be abandoning it, but I hope it'll help people with
 a .Net background get going quickly.

 I'm looking for input about what features I should focus on and just
 general comments on the worthiness of the project. I figure I'm bound
 to make mistakes by approaching this from a C/C++/C# programmer's
 perspective, and this might preclude that.

 Thanks.

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


Re: Is ClojureCLR converging toward a release?

2010-09-24 Thread eyeris
I am very encouraged to hear this. I'm looking forward to the binary
release.



On Sep 24, 10:24 am, dmiller dmiller2...@gmail.com wrote:
 I tagged a 1.2 release on the site.

 I have not put a separate 1.2 download or a binary release out there
 yet.  Someone has contributed an entirely new build process for
 ClojureCLR that includes support for either 3.5 or 4.0 builds, better
 binary managment on the builds and some other goodies.  Just waiting
 for that person's CA to be processed by Rich.

 -David

 On Sep 23, 10:26 pm, Mike K mbk.li...@gmail.com wrote:

  It was mentioned about six weeks ago that ClojureCLR was mostly 1.2
  compatible with a few outstanding issues and a couple dozen failing
  tests.  What is the status now?  Is there still an intention of an
  official binary release with 1.2 level functionality, or has that
  target been dropped?

     Thanks,
     Mike

-- 
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: Running on .Net

2010-08-09 Thread eyeris
I was able to build ClojureCLR using the DLR 1.0 source and the latest
clojure-clr in VS 2010. I am able to run Clojure.Main.exe and
Clojure.Compile.exe. Is there a way to integrate these into VS, so
that I can add .clj files to a project and set the build action to
Build or Build with Clojure.Compile.exe and get a .dll out the
other side?



On Aug 4, 8:45 pm, dmiller dmiller2...@gmail.com wrote:
 the 7/23 date is, as they say, not operational. I've edited that out.
 I'll go as far as 'soon'.  (The new PC I was going supposed to move to
 and install VS2010 on has to be replaced due to the possibility that
 the hard disk will fry.)

 You cannot use DLR 1.0.   I need things that are not in that release.
 As stated on the wiki page:

 'For the time being go http://dlr.codeplex.com/SourceControl/
 changeset/changes/48032:here to get version 48032.'

 With a binary distribution, at least I can package an approved version
 of the DLR.

 -David

 On Aug 4, 1:59 pm, eyeris drewpvo...@gmail.com wrote:



  I tried to build the latest ClojureCLR using VS 2008. I used the DLR
  1.0 release. I successfully replaced your DLR project references and
  built them:

 http://imgur.com/SgUmu.jpg

  Then I added a DLR reference to the Clojure project and built it,
  resulting in these two errors The extern alias MSC was not specified
  in a /reference option:

 http://imgur.com/LWjOs.jpg

  Your installing-clojureclr page says I know for sure that will work.
  I hope to bring everything up to VS2010 (and because of DLR, no more
  VS2008 for building) by 7/23/2010. but I didn't see anything in the
  commit history to suggest that you've done this.

  On Aug 4, 12:25 am, eyeris drewpvo...@gmail.com wrote:

   I would like a zip of DLLs that are as widely compatible as possible
   across CLR/DLR versions accompanied by a clear list of which versions
   are compatible.

   Regarding releases, I'm glad to lag behind the bleeding edge by a lot
   in order to have a stable platform. What I want to be able to do is
   grab the DLLs, add them as references to my VS project, and compile,
   much like I do with NetBeans and the JVM clojure.

   I have to admit that I haven't tried ClojureCLR since right around the
   1.1 release, so I don't remember the details of the problems that I
   encountered. I am in the process of migrating a lot of stuff from VS
   2008 to VS 2010. Once I finish that I will try ClojureCLR again and
   get back to you regarding embedding and AOT.

   On Aug 3, 3:11 pm, dmiller dmiller2...@gmail.com wrote:

I can move creating a binary distribution to the to top of the list.

I could use some guidance from the interested on what would serve the
purpose on this and other things mentioned here.

on the distribution:  Do you want just a zip of of DLLs?  An
installer?  Do you want installation to the GAC?

on 'stable, dependable': Is there any strategy on creating new
releases that makes sense?  Assume anyone wanting to stay on the
bleeding edge will build for themselves?

start-up speed:  I'mrunningsome experiments on that.   The problem
is mostly the monolithic nature of the assemblies created and the
amount of environment initialization.  Suggestions welcomed.

Ease of embeddability: please elaborate on the problems.

AOT'ing clj files:  Ditto.

-David

On Aug 3, 12:47 pm, Timothy Baldridge tbaldri...@gmail.com wrote:

  I really wish that ClojureCLR had a binary distribution. I like
  clojure a lot but I have a .Netbackground and a lot of .Netcode to
  interact with. If ClojureCLR had a stable, dependable binary
  distribution I would be able to use it at work much more than I
  already do. I don't care much about 1.2 features like defrecord. 
  What
  I care about is start-up speed, ease of embeddability, and Visual
  Studio integration (not Intellisense, just AOT'ing .clj files).

  +1 for all of that

 That paragraph basically explains why I haven't started using clojure
 at my work yet.

 Timothy Baldridge

-- 
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: Running on .Net

2010-08-04 Thread eyeris
I tried to build the latest ClojureCLR using VS 2008. I used the DLR
1.0 release. I successfully replaced your DLR project references and
built them:

http://imgur.com/SgUmu.jpg

Then I added a DLR reference to the Clojure project and built it,
resulting in these two errors The extern alias MSC was not specified
in a /reference option:

http://imgur.com/LWjOs.jpg

Your installing-clojureclr page says I know for sure that will work.
I hope to bring everything up to VS2010 (and because of DLR, no more
VS2008 for building) by 7/23/2010. but I didn't see anything in the
commit history to suggest that you've done this.


On Aug 4, 12:25 am, eyeris drewpvo...@gmail.com wrote:
 I would like a zip of DLLs that are as widely compatible as possible
 across CLR/DLR versions accompanied by a clear list of which versions
 are compatible.

 Regarding releases, I'm glad to lag behind the bleeding edge by a lot
 in order to have a stable platform. What I want to be able to do is
 grab the DLLs, add them as references to my VS project, and compile,
 much like I do with NetBeans and the JVM clojure.

 I have to admit that I haven't tried ClojureCLR since right around the
 1.1 release, so I don't remember the details of the problems that I
 encountered. I am in the process of migrating a lot of stuff from VS
 2008 to VS 2010. Once I finish that I will try ClojureCLR again and
 get back to you regarding embedding and AOT.

 On Aug 3, 3:11 pm, dmiller dmiller2...@gmail.com wrote:

  I can move creating a binary distribution to the to top of the list.

  I could use some guidance from the interested on what would serve the
  purpose on this and other things mentioned here.

  on the distribution:  Do you want just a zip of of DLLs?  An
  installer?  Do you want installation to the GAC?

  on 'stable, dependable': Is there any strategy on creating new
  releases that makes sense?  Assume anyone wanting to stay on the
  bleeding edge will build for themselves?

  start-up speed:  I'm running some experiments on that.   The problem
  is mostly the monolithic nature of the assemblies created and the
  amount of environment initialization.  Suggestions welcomed.

  Ease of embeddability: please elaborate on the problems.

  AOT'ing clj files:  Ditto.

  -David

  On Aug 3, 12:47 pm, Timothy Baldridge tbaldri...@gmail.com wrote:

I really wish that ClojureCLR had a binary distribution. I like
clojure a lot but I have a .Net background and a lot of .Net code to
interact with. If ClojureCLR had a stable, dependable binary
distribution I would be able to use it at work much more than I
already do. I don't care much about 1.2 features like defrecord. What
I care about is start-up speed, ease of embeddability, and Visual
Studio integration (not Intellisense, just AOT'ing .clj files).

    +1 for all of that

   That paragraph basically explains why I haven't started using clojure
   at my work yet.

   Timothy Baldridge

-- 
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: Running on .Net

2010-08-03 Thread eyeris
I really wish that ClojureCLR had a binary distribution. I like
clojure a lot but I have a .Net background and a lot of .Net code to
interact with. If ClojureCLR had a stable, dependable binary
distribution I would be able to use it at work much more than I
already do. I don't care much about 1.2 features like defrecord. What
I care about is start-up speed, ease of embeddability, and Visual
Studio integration (not Intellisense, just AOT'ing .clj files).



On Aug 3, 7:30 am, Hadi Hariri hadihar...@gmail.com wrote:
 I've gotten ClojureCLR running on .NET. If you're interested in trying
 it, ping me and I'll help with what I can.

 I'm also interested to know if there's some kind of installer or
 package provided for it yet because as you say it does take a bit to
 setup. I'd be eager to help in that area if there's interest.

 On 3 August 2010 09:16, taotree jshell...@gmail.com wrote:

  I have a 3rd party platform I am working to write add-ons for and so
  am restricted to .Net. I'd like to write in Clojure. ClojureCLR looked
  too intimidating to get it going and ikvmc was very easy for Java, so
  I thought I'd try it with Clojure.

  I ran ikvmc on clojure.jar and saw a number of errors (or something),
  but ignored them, and it did create clojure.dll. I ran ikvmc on my
  own .class files that were generated by the compile macro.

  Trying to call a method on my class (with clojure.dll referenced)
  resulted in:

  Unhandled Exception: System.TypeInitializationException: The type
  initializer fo
  r 'test.clojure.MyClass' threw an exception. ---
  System.TypeInitializationExcep
  tion: The type initializer for 'clojure.lang.RT' threw an exception.
  --- java.l
  ang.RuntimeException: java.io.FileNotFoundException: Could not locate
  clojure/co
  re__init.class or clojure/core.clj on classpath:
    --- End of inner exception stack trace ---
    at clojure.lang.Namespace..ctor(Symbol )
    at clojure.lang.Namespace.findOrCreate(Symbol name)
    at clojure.lang.Var.internPrivate(String nsName, String sym)
    at test.clojure.MyClass..cctor()
    --- End of inner exception stack trace ---
    at test.clojure.MyClass.main(String[] strarr)
    at StartupCode$FSTestApp.$Mentics.Series.App.main@() in C:\Users
  \jshellman\
  Documents\Visual Studio 2008\Projects\FSTestForNT\FSTestApp
  \Mentics.Series.App.f
  s:line 14

  --
  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: Running on .Net

2010-08-03 Thread eyeris
I would like a zip of DLLs that are as widely compatible as possible
across CLR/DLR versions accompanied by a clear list of which versions
are compatible.

Regarding releases, I'm glad to lag behind the bleeding edge by a lot
in order to have a stable platform. What I want to be able to do is
grab the DLLs, add them as references to my VS project, and compile,
much like I do with NetBeans and the JVM clojure.

I have to admit that I haven't tried ClojureCLR since right around the
1.1 release, so I don't remember the details of the problems that I
encountered. I am in the process of migrating a lot of stuff from VS
2008 to VS 2010. Once I finish that I will try ClojureCLR again and
get back to you regarding embedding and AOT.



On Aug 3, 3:11 pm, dmiller dmiller2...@gmail.com wrote:
 I can move creating a binary distribution to the to top of the list.

 I could use some guidance from the interested on what would serve the
 purpose on this and other things mentioned here.

 on the distribution:  Do you want just a zip of of DLLs?  An
 installer?  Do you want installation to the GAC?

 on 'stable, dependable': Is there any strategy on creating new
 releases that makes sense?  Assume anyone wanting to stay on the
 bleeding edge will build for themselves?

 start-up speed:  I'm running some experiments on that.   The problem
 is mostly the monolithic nature of the assemblies created and the
 amount of environment initialization.  Suggestions welcomed.

 Ease of embeddability: please elaborate on the problems.

 AOT'ing clj files:  Ditto.

 -David

 On Aug 3, 12:47 pm, Timothy Baldridge tbaldri...@gmail.com wrote:

   I really wish that ClojureCLR had a binary distribution. I like
   clojure a lot but I have a .Net background and a lot of .Net code to
   interact with. If ClojureCLR had a stable, dependable binary
   distribution I would be able to use it at work much more than I
   already do. I don't care much about 1.2 features like defrecord. What
   I care about is start-up speed, ease of embeddability, and Visual
   Studio integration (not Intellisense, just AOT'ing .clj files).

   +1 for all of that

  That paragraph basically explains why I haven't started using clojure
  at my work yet.

  Timothy Baldridge

-- 
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: basic help with netbeans/enclojure installation

2010-06-16 Thread eyeris
Which version of NetBeans did you install? Version 6.9 (the version
linked to on the netbeans.org front page) was released very recently.
It's unlikely that Enclojure has been updated for NetBeans 6.9.

On Jun 16, 5:29 pm, Lee Spector lspec...@hampshire.edu wrote:
 Starting from scratch, both to try it myself and to know what to tell my 
 students in the fall, when I'll want them all (regardless of background) to 
 be able to set up a reasonable Clojure environment without hassles. I've 
 never previously used netbeans. I'm doing this on a Mac running MacOS 10.6.3.

 I tried to follow the instructions 
 athttp://www.assembla.com/wiki/show/clojure/Getting_Started_with_Netbea...and 
 this is what happened:

 - Install NetBeans You need only the Java SE version.

 Done -- no problem.

 - If you’ve just installed Netbeans, activate feature Java SE:
   - Activate features is on the Start page
   - or from Tools, Plugins, Installed

 I don't see Activate features on the start page. Poked around (there are 
 three tabs...) but still didn't see it. Went to Tools, Plugins, Installed and 
 saw that there wasn't just one Java SE item but rather many. Checked all of 
 them. Now that I return to it I see that everything has a checkmark under 
 Active, so perhaps it was all activated initially and I didn't notice? In any 
 event I suppose it's all activated now.

 - Go to the Tools, Plugins and select the 'Settings' tab on the dialog
 - Click Add and call the Update Center Enclojure and use the following url:
    http://www.enclojure.org/file/view/Autoupdate_Site.xml.gz

 Done -- no problem.

 - Go to the 'Avalilable Plugins' tab and select the Enclojure Clojure Plugin 
 and click Install

 When I do it fails with the following messages:

 -
 Some plugins require plugin Common Scripting Language API (new) to be 
 installed.

 The plugin Common Scripting Language API (new) is requested in version = 
 1.14.1.1.1.1.2 (release version 1) but only 2.5.1.2.1.1.4 (of release version 
 different from 1) was found.

 The following plugin is affected:
       Enclojure Clojure Plugin
 Some plugins require plugin Editor Library to be installed.

 The plugin Editor Library is requested in version = 1.44.1.9.2 (release 
 version 1) but only 2.10.1.10.2 (of release version different from 1) was 
 found.

 The following plugin is affected:
       Enclojure Clojure Plugin
 Some plugins require plugin org.netbeans.modules.templates to be installed.

 The plugin org.netbeans.modules.templates is requested in version 1.7.1.

 The following plugin is affected:
       Enclojure Clojure Plugin

 Some plugins not installed to avoid potential installation problems.
 -

 And then I'm stuck. Is there a simple way to take care of this?

 Thanks,

  -Lee

 --
 Lee Spector, Professor of Computer Science
 School of Cognitive Science, Hampshire College
 893 West Street, Amherst, MA 01002-3359
 lspec...@hampshire.edu,http://hampshire.edu/lspector/
 Phone: 413-559-5352, Fax: 413-559-5438

 Check out Genetic Programming and Evolvable 
 Machines:http://www.springer.com/10710-http://gpemjournal.blogspot.com/

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


Re: Newbie (with no Java experience) - how best to learn?

2010-05-27 Thread eyeris
The Full Disclojure video series is targeted more toward the lisp
newbie, but it contains a series of videos touring different
development environments. http://vimeo.com/channels/fulldisclojure


On May 27, 6:53 am, Paul Moore p.f.mo...@gmail.com wrote:
 Hi,
 I'm new to Clojure, and looking for the best way to get going. I've
 got a pretty broad experience of various programming languages (C,
 Python, Lua, Factor, JavaScript, Haskell, Perl, ...) including a bit
 of experience with Lisp-like languages, so the language itself isn't
 likely to be a huge problem for me. But I've no background with Java
 (beyond a few toy programs, and knowing the syntax) so the
 environment (classpaths, compiling, where to find libraries,
 performance, JVMs, etc) is pretty much a mystery to me.

 I've browsed a bit online, read some of the wikibook articles, and
 Mark Volkmann's excellent summary, but I'd like to dig a bit deeper
 (as I say, particularly around libraries and environment, less on how
 to program in a lisp-like language). Ideally, in a form that I can
 read offline (printable/PDF documents, or books) as I've got limited
 free time I can spend in front of a computer screen. I've got a sample
 program I have tried porting from Python - the experience was
 interesting, but limited (the core of the relatively complex
 multithreaded database monitoring process converted to 47 lines of
 Clojure...!!!)

 Has anybody got any good suggestions as to where I should go next?
 I've considered getting one of the Manning books (The Joy of Clojure
 or Clojure in Action) but I'm not sure which would be better for me -
 they seem broadly similar, with Clojure in Action looking like a
 slightly better fit for my needs, but I'd appreciate any
 comments/recommendations). Also, I wonder whether there's some
 Java-based documentation that would be worth my while investigating. I
 suspect that it'd be very easy to get sucked into a huge amount of
 detail which is only tangentially related at best, but I'm sure an
 overview would help.

 Thanks for any suggestions,
 Paul.

-- 
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 I have chosen not to employ clojure

2010-03-22 Thread eyeris
 I agree with Stuart that the user experience should be friendly on all
 supported platforms.

I also agree. The best setup experience I've had so far is using
NetBeans with the Enclojure plugin.

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

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: clj-native 0.8.1

2010-03-18 Thread eyeris
clj-segfault

j/k :)

Seriously though, thank you for working on this. I'm sure it will
remove a serious barrier to entry for some people.



On Mar 13, 1:14 pm, mac markus.gustavs...@gmail.com wrote:
 Hello all.
 I have had some time lately to work on my C FFI for Clojure and I
 think it's pretty much feature complete now.
 It has support for functions, callbacks, structures, unions and
 globals.
 For structures there is support for different alignments.

 The library has two main namespaces: clj-native.direct and clj-
 native.dynamic.
 The direct namespace uses the direct mapping feature of JNA in order
 to be as efficient and arity and type safe as possible. However, it
 does not support varargs functions since they require reflection and
 dynamic translation of the parameters. That's what the dynamic
 namespace is for: It can map any C function into clojure, even vararg
 functions like printf but at a higher cost in call time and less
 safety (it's easy to crash the jvm by sending the wrong type or number
 of parameters). Access to global variables through the JNA Pointer
 class is also available in the dynamic namespace.

 The library is available from github:http://github.com/bagucode/clj-native
 and clojars:http://clojars.org/clj-native

 Example usage of the direct namespace can be found 
 here:http://github.com/bagucode/clj-native/blob/master/src/examples/c_lib.clj

 Please report issues or make requests to my github account or by mail.

 Enjoy!

 /Markus

-- 
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: Simple functional programming lexicon?

2010-03-17 Thread eyeris
On Mar 17, 7:28 am, Ben Armstrong synerg...@gmail.com wrote:
 Or should I just ignore threads like Why do functions in the state monad 
 only accept one value?

Yes, ignore those for now. Write an entire program in Clojure before
you read anything about monads. They aren't required. When I first
dipped my toes in the functional waters I learned a lot from Casting
SPELs in LISP[1]. It's based around Common Lisp, but it should be
easily translatable to Clojure.

[1] http://www.lisperati.com/casting.html

-- 
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: Some basic guidance to designing functional vs. state parts of app

2010-03-03 Thread eyeris
One aspect of your question that makes it difficult to answer is that
you don't explain what the repercussions should be (in terms of
synchronization) when a new applicant or job enters the pool or a new
skill is attributed to an applicant. Should the job-applicant
matching function be restarted? Are you simply trying to isolate the
matching algorithm from updates to the data structures?



On Mar 2, 10:34 pm, Sophie itsme...@hotmail.com wrote:
 As a bit of a newbie to the functional + identity/state design space,
 I'm struggling a bit with where to use identity constructs (refs) and
 where to stay with pure functions, and could use some guidance. Pardon
 me if some of my terms are a bit off. Here is a simple hypothetical
 app for matching Applicants to Jobs.

 I have several Applicants, each with some set of Skills. There are
 several Jobs, each with some Requirements. There is some Match
 relation between Skills and the Jobs they can match. The set of
 Applicants, each of their skills, and the set of Jobs can change with
 time. There is a set of Jobs that each Applicant can fill,
 functionally computed from applicant skills  job requirements 
 Match.

 Ok, so jobs_that_an_applicant_can_fill is a pure function, I get
 that.

 Do I design a single World ref whose state changes with time to
 different worlds, so adding a new Applicant or even adding a new Skill
 to an existing Applicant results in a new World value? Or is it better
 to have an Applicants ref and a Jobs ref that refer to different
 sets of those er.. things?

 Can each Applicant have a skills ref, whose state changes to
 different sets of Skills? Should I design it this way?

 How do I choose? What are the trade-offs?

 Any and all guidance, insights, advice etc. welcome!

 Thanks!

-- 
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: side effects in fn passed to filter

2010-02-18 Thread eyeris
On Feb 18, 9:34 am, Rowdy Rednose rowdy.redn...@gmx.net wrote:

 better-unique is not too far off from my initial approach, but still,
 why no side effects?
 Even though I do not know when the side-effects happen (lazily,
 eagerly), shouldn't the order be fixed in case of filter?

I think the term must in the documentation refers to side-effects on
the seq. General advice would say that the predicate must be free of
side effects if you want to keep your sanity and not die at the hands
of an angry mob of programmers who are later forced to use your
code :)

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

2010-01-27 Thread eyeris
Exotic? You got it! Madison, WI! Seriously, we have the best bars. See
you guys in the fall! :)

I would prefer it during the week.



On Jan 22, 3:15 pm, Wilson MacGyver wmacgy...@gmail.com wrote:
 I vote let's turn this into a clojure vacation, and hold it in an
 exotic location.

 Otherwise, hey, Columbus Ohio is as good as any other city. :)



 On Fri, Jan 22, 2010 at 3:50 PM, Sean Devlin francoisdev...@gmail.com wrote:
  Clearly you haven't taken into account that Philadelphia is more
  central wrt the big cities :)

  On Jan 22, 3:32 pm, Fogus mefo...@gmail.com wrote:
  Since Clojure is clearly an East-Coast language, I suggest DC as the
  most logical locale.  (hopes someone buys this line of reasoning)

  -m

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

 --
 Omnem crede diem tibi diluxisse supremum.

-- 
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: Closures in java

2009-11-28 Thread eyeris
It's also important to get features into Java if you want real
substantial JVM performance tuning for them.


On Nov 28, 11:58 am, Christian Vest Hansen karmazi...@gmail.com
wrote:
 Having closures in Java is important because it potentially means type
 compatibility for closures across languages. I don't think there will
 be a one language to rule the JVM, so features that make it easier to
 interoperate multiple languages are useful.

 Also, libraries written in Java with closures in mind can now settle
 on a representation, and so interoperability is gained in this area
 too.



 On Sat, Nov 28, 2009 at 6:25 PM, Daniel Simms daniel.si...@gmail.com wrote:
  No comments on this:

   http://blogs.sun.com/mr/entry/closures

  yet?   It's no help to Clojure, but it's nice to see similar
  motivations.

  Also, I wanted to chime in with something like we already have
  closures: use Clojure! or Jython, or...  So how about TCO?

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

 --
 Venlig hilsen / Kind regards,
 Christian Vest Hansen.

-- 
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: feedback on this code

2009-10-27 Thread eyeris

Or you can stick (sku, quantity) pairs in a cookie. However,
personally I prefer sessions.



On Oct 27, 9:54 am, Robert Campbell rrc...@gmail.com wrote:
 Wow, thank you very much. That's definitely a lot simpler. I'm going
 to try reimplementing it via your suggestions and see how it goes.

 I like your idea about not maintaining cart state on the server,
 because it would make my functions easier to test and debug (no need
 to setup  teardown a fake session) but I'm not sure it would work
 well in practice. If a user is browsing Amazon, for example, they
 might add something to their cart, then visit 10 random pages before
 they go to checkout. I would need to embed the cart in each of these
 pages and resubmit the cart to the server for each request. The
 purpose of sessions are to avoid exactly this hairy situation.

 I wrapped cart in a Ref in case multiple browser windows are open and
 there is a concurrent add to cart click.

 On Tue, Oct 27, 2009 at 12:41 PM, Timothy Pratley

 timothyprat...@gmail.com wrote:

  Hi Robert

  On Oct 27, 9:48 pm, Robert Campbell rrc...@gmail.com wrote:
  Hey guys, I'm looking for _any_ feedback/thoughts on this Clojure code
  I wrote. I just feel like the entire thing is way too complex, but I'm
  not sure about how to simplify it. I wanted to try something real
  world so I made a simple shopping cart ref to put in a session:

  Great, an open invitation!

  structs are really no different from maps except as a performance
  optimisation (and not a huge one). So dropping the structs would
  remove some boilerplate if simplicity is your goal. Also why not make
  the cart a map of products to qty and forget about subtotal...
  subtotal and total are easily calculated by separate functions for
  view or checkout... something like (untested at all):

  (defn add-to-cart [product qty]
   (if (pos? qty)
     (dosync (alter cart update-in [product] #(+ qty (if % % 0)

  (defn update-cart [product qty]
   (dosync (alter cart assoc product qty)))

  (defn remove [product]
   (dosync (alter cart dissoc product)))

  (defn subtotal [product]
   (* (@cart product) (price product)))

  (defn total []
   (reduce + (map subtotal @cart)))

  But in a real-world example I'm not sure a ref would be the best way
  to deal with the state... wouldn't you have the cart sent up in the
  request and a new cart returned? ie: you wouldn't need to maintain a
  ref on the server, just provide the hooks for building a cart and
  checking out. So the functions might be better if they take a cart as
  input and return a cart. Doing that pretty much makes them empty
  functions:
  (defn remove [cart product]
   (dissoc cart product))
  So do you even need a remove function? Maybe not.

  Just some thoughts - I'm no web-shop programmer so disclaimer
  attached.

  Regards,
  Tim.

  Regards,
  Tim.
--~--~-~--~~~---~--~~
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: PATCH: AFn.java, RestFN.java (a better throwArity message)

2009-10-25 Thread eyeris

+1, This would have helped me a lot when I first came to Clojure (from
a non-lisp background).


On Oct 25, 11:57 am, MarkSwanson mark.swanson...@gmail.com wrote:
 Hello,

 Someone recently posed the question: (why doesn't this work)
 (into {} (map #([% (* % %)]) [1 2 3 4]))

 (reference:http://groups.google.com/group/clojure/browse_thread/thread/7d3ee57ee...)

 The error message was:
 Caused by: java.lang.IllegalArgumentException: Wrong number of args
 passed to: PersistentVector

 How many args were being passed anyway? The code looked fine (to me).
 It would have been helpful to me to know the number of args being
 passed was zero.

 With the patch below the error message would look like this:

 ... java.lang.IllegalArgumentException: Wrong number of args (0)
 passed to: PersistentVector ...

 The patch will handle all cases of wrong arity and report the expected
 number of args. In some cases (RestFN) the exception will now report
 the required arity as well as the given arity.

 There is one improvement that could still be made to the patch:
 applyTo(ISeq args) - should report the count of args:
 -   return throwArity();
 +   return throwArity(-1, reqArity); // TODO/BUG: -1 should be count
 of args

 I'm running out the door and don't have time to code this.

 Please consider this patch - or something like it.

 diff --git a/src/jvm/clojure/lang/AFn.java b/src/jvm/clojure/lang/
 AFn.java
 index e2646ad..56afa8f
 100644
 --- a/src/jvm/clojure/lang/
 AFn.java
 +++ b/src/jvm/clojure/lang/
 AFn.java
 @@ -45,110 +45,110 @@ public void run()
 {

  public Object invoke() throws Exception
 {
 -       return throwArity
 ();
 +       return throwArity
 (0);
  }

  public Object invoke(Object arg1) throws Exception
 {
 -       return throwArity
 ();
 +       return throwArity
 (1);
  }

  public Object invoke(Object arg1, Object arg2) throws Exception
 {
 -       return throwArity
 ();
 +       return throwArity
 (2);
  }

  public Object invoke(Object arg1, Object arg2, Object arg3) throws
 Exception{
 -       return throwArity
 ();
 +       return throwArity
 (3);
  }

  public Object invoke(Object arg1, Object arg2, Object arg3, Object
 arg4) throws Exception
 {
 -       return throwArity
 ();
 +       return throwArity
 (4);
  }

  public Object invoke(Object arg1, Object arg2, Object arg3, Object
 arg4, Object arg5) throws Exception
 {
 -       return throwArity
 ();
 +       return throwArity
 (5);
  }

  public Object invoke(Object arg1, Object arg2, Object arg3, Object
 arg4, Object arg5, Object arg6) throws Exception
 {
 -       return throwArity
 ();
 +       return throwArity
 (6);
  }

  public Object invoke(Object arg1, Object arg2, Object arg3, Object
 arg4, Object arg5, Object arg6, Object
 arg7)
                 throws Exception
 {
 -       return throwArity
 ();
 +       return throwArity
 (7);
  }

  public Object invoke(Object arg1, Object arg2, Object arg3, Object
 arg4, Object arg5, Object arg6, Object
 arg7,
                       Object arg8) throws Exception
 {
 -       return throwArity
 ();
 +       return throwArity
 (8);
  }

  public Object invoke(Object arg1, Object arg2, Object arg3, Object
 arg4, Object arg5, Object arg6, Object
 arg7,
                       Object arg8, Object arg9) throws Exception
 {
 -       return throwArity
 ();
 +       return throwArity
 (9);
  }

  public Object invoke(Object arg1, Object arg2, Object arg3, Object
 arg4, Object arg5, Object arg6, Object
 arg7,
                       Object arg8, Object arg9, Object arg10) throws
 Exception{
 -       return throwArity
 ();
 +       return throwArity
 (10);
  }

  public Object invoke(Object arg1, Object arg2, Object arg3, Object
 arg4, Object arg5, Object arg6, Object
 arg7,
                       Object arg8, Object arg9, Object arg10, Object
 arg11) throws Exception
 {
 -       return throwArity
 ();
 +       return throwArity
 (11);
  }

  public Object invoke(Object arg1, Object arg2, Object arg3, Object
 arg4, Object arg5, Object arg6, Object
 arg7,
                       Object arg8, Object arg9, Object arg10, Object
 arg11, Object arg12) throws Exception
 {
 -       return throwArity
 ();
 +       return throwArity
 (12);
  }

  public Object invoke(Object arg1, Object arg2, Object arg3, Object
 arg4, Object arg5, Object arg6, Object
 arg7,
                       Object arg8, Object arg9, Object arg10, Object
 arg11, Object arg12, Object
 arg13)
                 throws Exception
 {
 -       return throwArity
 ();
 +       return throwArity
 (13);
  }

  public Object invoke(Object arg1, Object arg2, Object arg3, Object
 arg4, Object arg5, Object arg6, Object
 arg7,
                       Object arg8, Object arg9, Object arg10, Object
 arg11, Object arg12, Object arg13, Object
 arg14)
                 throws Exception
 {
 -       return throwArity
 ();
 +       return throwArity
 (14);
  }

  public Object invoke(Object arg1, Object arg2, Object arg3, Object
 arg4, Object arg5, Object arg6, Object
 

Re: Clojure in a big Java solution

2009-10-24 Thread eyeris

It's difficult to provide advice without more information about your
current code. You say that you want a part of your system, which
manipulates a lot of objects, to run in parallel. Do you mean that you
want this part of the system to run parallel to the other parts -or-
do you mean that this part will remain in sequence with the other
parts of the system, but it will run its own tasks in parallel?
Furthermore, what do you expect to gain from the parallelism? If it's
simple divide-and-conquer parallelism to process a chunk of data
faster, then that is pretty easy to implement in Java, so long as the
data is dividable. On the other hand, if you want this part of your
system to run in parallel with the other parts, then there's a wide
spectrum of Clojure/Java mixes that could make sense. Like I said
above, we'll need much more information before we can provide any
valuable advice.




On Oct 23, 7:41 am, vanallan vanal...@gmail.com wrote:
 Hi!
 I am currently investigating if it is possible to convert a part of a
 big Java system to Clojure. The reason for this is to make this part
 run in parallel and hence ease the implementation by porting it to
 Clojure. The problem is that these parts of the system is today
 setting and changing a lot mutable data in a lot of different objects.

 Which approach do you think i should have when i try to port these
 Java methods? Should i try to retain the Java structure and change
 these objects or is it better to create my own data structure and
 somehow manage them? Does anyone have any experience in integrating
 Clojure in a big Java solution? Also i should mention that i'm quite
 new to Clojure, and functional programming overall. :)

 Thanks
--~--~-~--~~~---~--~~
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 is Lisp compiled ahead of time?

2009-10-21 Thread eyeris

I don't know how detailed of an explanation you want. The most basic
explanation is that not everything is compiled to byte code in the
manner that a C compiler usually generates machine code. Instead the
runtime, which would interpret most lisps, is bundled with the code as
a library.



On Oct 21, 10:58 am, CuppoJava patrickli_2...@hotmail.com wrote:
 Hi,
 Clojure started my interest in programming languages, and I'm
 wondering exactly how LISP-like languages get compiled ahead of time?
 A link to a tutorial would be much appreciated.

 The part that I'm having trouble understanding is the fact that
 functions can be defined at runtime. How do you compile a function
 that's not defined until after you run the program?

 Thanks for your help
   -Patrick
--~--~-~--~~~---~--~~
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: b:vimclojure_namespace does not exist

2009-10-20 Thread eyeris

After further investigation, I've determined that it is silently
catching an exception in autoload/vimclojure.vim in
vimclojure#InitBuffer() around line 668.
Commenting out the try/catch/endtry lines gives me the error:

~/devel/xlsmerge/src/xlsmerge/gui.clj 186L, 6430C
Error detected while processing function
vimclojure#InitBuffer..vimclojure#ExecuteNailWithInput:
line   19:
Couldn't execute Nail! java.lang.NoClassDefFoundError: clojure/lang/
IFn at java.lang.Class.forName0(Native Method) at
java.lang.Class.forName(Class.java:186) at
com.martiansoftware.nailgun.NGSession.run(Unknown Source)
Error detected while processing function vimclojure#InitBuffer:
line9:
E171: Missing :endif
Error detected while processing /home/dvogel/.vim/syntax/clojure.vim:
line   19:
E171: Missing :endif
Error detected while processing function SNR5_SynSet:
line   22:
E170: Missing :endfor

Running the command manually gives a more readable error:

~/devel/xlsmerge$ ~/devel/clj/vimclojure/ng
de.kotka.vimclojure.nails.NamespaceOfFile ~/devel/xlsmerge/src/
xlsmerge/gui.clj
java.lang.NoClassDefFoundError: clojure/lang/IFn
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:186)
at com.martiansoftware.nailgun.NGSession.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: clojure.lang.IFn
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:336)
... 3 more





On Oct 19, 10:42 pm, eyeris drewpvo...@gmail.com wrote:
 I've installed the latest VimClojure. I've added to my .vimrc:

 let g:clj_want_gorilla = 1
 let vimclojure#NailgunClient = .../path/to/ng
 au BufRead,Bufnewfile *.clj setfiletype clojure
 au BufRead,Bufnewfile *.clj setl lisp

 The ng client is executable. Yet when I open a .clj file, echo
 b:vimclojure_namespace I get two errors:

 E121: Undefined variable: b:vimclojure_namespace
 E15: Invalid expression: b:vimclojure_namespace

 VimClojure shouldn't be so hard to get working. This is my third time
 setting it up (once on Windows, once on two versions of Debian) and it
 never works according to the directions.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



b:vimclojure_namespace does not exist

2009-10-19 Thread eyeris

I've installed the latest VimClojure. I've added to my .vimrc:

let g:clj_want_gorilla = 1
let vimclojure#NailgunClient = .../path/to/ng
au BufRead,Bufnewfile *.clj setfiletype clojure
au BufRead,Bufnewfile *.clj setl lisp

The ng client is executable. Yet when I open a .clj file, echo
b:vimclojure_namespace I get two errors:

E121: Undefined variable: b:vimclojure_namespace
E15: Invalid expression: b:vimclojure_namespace

VimClojure shouldn't be so hard to get working. This is my third time
setting it up (once on Windows, once on two versions of Debian) and it
never works according to the directions.
--~--~-~--~~~---~--~~
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: La Clojure plugin for IntelliJ IDEA moved to Git

2009-10-18 Thread eyeris

Once I build the plugin with the latest clojure, can I use it to write
code targeting 1.0?



On Oct 17, 11:21 am, Ilya Sergey ilyas...@gmail.com wrote:
 Hi all.

 After the long silence we resume work on `La Clojure' plugin for IntelliJ
 IDEA. It is still open-source and available now for IntelliJ IDEA 9
 Community Edition. The repository may be cloned now from
 git://git.jetbrains.org/idea/clojure-plugin.git
 To build the plugin from scratch you need the latest of Clojure and
 clojure-contrib jars, so before running ant don't forget to edit
 clojure.properties file in the root of the `clojure-plugin' project as
 appropriate.

 Cheers!
 Ilya
--~--~-~--~~~---~--~~
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: What does this error mean?

2009-10-08 Thread eyeris

What JDK/JRE version?

On Oct 8, 8:38 am, kunjaan kunj...@gmail.com wrote:
 java.lang.ClassFormatError: Unknown constant tag 52 in class file
 queries__init (Trial.clj: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: Modeling Data Associations in Clojure?

2009-09-16 Thread eyeris

If you already have a data model mapped to an object model via
Hibernate (or similar Java-based product), you could simply wrap a
clojure API around those classes via the Java interop. However, I
don't know of an example of published code that does this.


On Sep 14, 4:34 pm, Brenton bashw...@gmail.com wrote:
 I am starting to write a large web application using Clojure and
 Compojure and am running into some design trouble while designing my
 data model. To illustrate my problem I am going to make up some fake
 data. Suppose you are writing an Insurance application which has the
 tables Policy, Person and Vehicle. A policy has a person that is the
 policy holder. A policy also has many vehicles. Each vehicle has a
 person that is the primary driver. Most of the time the primary driver
 is the same as the policy holder. If I were using one of the usual
 object-relational mapping frameworks, (Hibernate, ActiveRecord) when I
 load a policy I would get an object graph. If the person who is the
 policy holder is the same as the person who is the primary driver of
 the vehicle then the loaded Person object would be the same object. If
 I change the address of the policy holder the primary driver's address
 will also be changed.

 How do people deal with this sort of thing in a Clojure application
 (or any other functional language)? At first I thought that it would
 be easy and I would just use nested maps. But this causes all kinds of
 problems.  If I load the data into nested maps I now have two distinct
 maps for the same person. If I change one of them, the other is not
 updated. If I try to save this map back to the database, which person
 map has the correct data? It is also awkward to update the person in
 the first place. In Java you would just go policy.getPolicyHolder
 ().setAddress(...). In Clojure you would have to do something like
 (assoc policy :holder (assoc (:holder policy) :address ...)).

 I have a feeling that there is a more functional way to do this sort
 of thing. My question is, how to other people deal with this? The only
 thing that I can think of is that I would avoid using nested maps to
 model the database associations. I would load the policy into a map.
 Then if I need the person, I would load that into a separate map. That
 may be the correct functional approach. I was just asking in case
 there is some really cool thing that people do that I don't know
 about.

 I had a look at clj-record to see how associations where handled. It
 looks like nested maps are avoided here. Instead functions are created
 to retrieve the associated data. Is the correct way of this this?

 Thank you,
 Brenton
--~--~-~--~~~---~--~~
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: Modeling Data Associations in Clojure?

2009-09-16 Thread eyeris

Like I said, this applies if you already have a data model mapped to
an object model via Hibernate. You can leverage that mapping for the
time being and write what code originally prompted you to take up
clojure. This is especially attractive when you are introducing
clojure into a production program that is in production.

Wrapping your java objects with a clojure API does not require you to
retain the semantics. It only requires you to translate them to
clojure, which I think would be easier than translating the relational
database semantics to clojure.

If you don't already have your data mapped to an object model, then
it's likely not worth the effort. In that case, look into one of the
other suggestions on this thread.


On Sep 16, 5:24 pm, Dragan Djuric draga...@gmail.com wrote:
 Yes, but then it's just Java semantics disguised in a lispy syntax.
 What I really like in Clojure are immutable data structures,
 multimethods, closures, macros etc.
 If we have to use Hibernate and Spring and all that (which is not bad,
 but still looks too complex and bloated from the perspective of FP)
 then why bother with Clojure...
 Don't get me wrong: I think that Java interop is the most important
 feature of Clojure, but for calling libraries, not building on
 frameworks.

 On Sep 16, 9:50 pm, eyeris drewpvo...@gmail.com wrote:

  If you already have a data model mapped to an object model via
  Hibernate (or similar Java-based product), you could simply wrap a
  clojure API around those classes via the Java interop. However, I
  don't know of an example of published code that does this.

  On Sep 14, 4:34 pm, Brenton bashw...@gmail.com wrote:

   I am starting to write a large web application using Clojure and
   Compojure and am running into some design trouble while designing my
   data model. To illustrate my problem I am going to make up some fake
   data. Suppose you are writing an Insurance application which has the
   tables Policy, Person and Vehicle. A policy has a person that is the
   policy holder. A policy also has many vehicles. Each vehicle has a
   person that is the primary driver. Most of the time the primary driver
   is the same as the policy holder. If I were using one of the usual
   object-relational mapping frameworks, (Hibernate, ActiveRecord) when I
   load a policy I would get an object graph. If the person who is the
   policy holder is the same as the person who is the primary driver of
   the vehicle then the loaded Person object would be the same object. If
   I change the address of the policy holder the primary driver's address
   will also be changed.

   How do people deal with this sort of thing in a Clojure application
   (or any other functional language)? At first I thought that it would
   be easy and I would just use nested maps. But this causes all kinds of
   problems.  If I load the data into nested maps I now have two distinct
   maps for the same person. If I change one of them, the other is not
   updated. If I try to save this map back to the database, which person
   map has the correct data? It is also awkward to update the person in
   the first place. In Java you would just go policy.getPolicyHolder
   ().setAddress(...). In Clojure you would have to do something like
   (assoc policy :holder (assoc (:holder policy) :address ...)).

   I have a feeling that there is a more functional way to do this sort
   of thing. My question is, how to other people deal with this? The only
   thing that I can think of is that I would avoid using nested maps to
   model the database associations. I would load the policy into a map.
   Then if I need the person, I would load that into a separate map. That
   may be the correct functional approach. I was just asking in case
   there is some really cool thing that people do that I don't know
   about.

   I had a look at clj-record to see how associations where handled. It
   looks like nested maps are avoided here. Instead functions are created
   to retrieve the associated data. Is the correct way of this this?

   Thank you,
   Brenton
--~--~-~--~~~---~--~~
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 Golf – Episode 2: Largest Prime Factor

2009-09-09 Thread eyeris

Why did you define the problem as you did rather than simply The
largest prime factor of n?


On Sep 9, 1:39 pm, Fogus mefo...@gmail.com wrote:
 ;; largest prime factor
 (defn lpf
   Takes a number n and a starting number d  1
    and calculates the largest prime factor of n
    starting at number d.

    usage: (lpf 364362978 2) = 8675309
   [n d]
   (if ( d n)
     (- d 1)
     (recur
      (#(if (zero? (rem % d))
          (recur (/ % d))
          %)
       n)
      (inc d

 This is the smallest `lpf` that I could come up with -- can you do
 better?  Can you make it faster (shouldn't be too hard, considering
 mine is atrociously slow)?

 More information 
 at:http://blog.fogus.me/2009/09/09/clojure-golf-episode-2-largest-prime-...

 Have at it!

 -m
--~--~-~--~~~---~--~~
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: Importing All from java package?

2009-09-03 Thread eyeris

I'm pretty sure that you need to either name each class you want to
import inside your :import form or you need to import the package and
then each use of the classes in that package need to be manually
resolved (e.g. org.eclipse.jface/IDocument). Though I never have been
able to use the ns macro correctly the first time, so perhaps there is
a way I haven't found.


On Sep 3, 5:31 pm, Gorsal s...@tewebs.com wrote:
 Hello! I was just wandering if it was possible to import all from a
 java package . For example, in java i can do

 import org.eclipse.jface.text.*;

 And i can use IDocument, which is contained under
 org.eclipse.jface.text.IDocument;
 In clojure, I try

 (ns ParenMatcher
   (:gen-class
     :implements [ICharacterPairMatcher]
     :state state
     :init init)
   (:use [genutils])
   (:import
     [org.eclipse.jface]
     [org.eclipse.swt]
     [org.eclipse.jface.text]
     [org.eclipse.swt.widgets]))

 But, whenever i try to use an IDocument it throws an error like
 java.lang.Exception: No such namespace: IDocument (ParenMatcher.clj:
 14)

 Help??? Thanks!
--~--~-~--~~~---~--~~
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: for those who just can't get enough of monads

2009-09-01 Thread eyeris

Thanks for the link. I've tried and tried to understand monads, with
little success. It's lead me to the conclusion that monads won't
easily become one of the dominating approaches to program
organization. This is because, as the document says, without an
understanding of category theory, it's like talking about electricity
without using calculus. Good enough to replace a fuse, not good enough
to design an amplifier. Yet the easy introduction to category
theory in this document (and every other I've read) is anything but
easy for software engineers otherwise unconcerned with advanced or
abstract mathematics.

For monads to gain widespread support, someone will have to do a few
things. First encode monadic operations into the OOP features of Java
or C#. Then use them to solve a bunch of problems familiar in those
cultures in a way that the gains are substantial and obvious, without
incurring the overhead of a complete code reorganization. Essentially,
monads will have to find a bunch of back doors into the engineering
toolbox, a little like LINQ in C# (the IQueryable API, not the special
query syntax). Monads tutorials are simply not going to get the job
done.



On Aug 31, 12:45 pm, Raoul Duke rao...@gmail.com wrote:
 http://patryshev.com/monad/crashcourse.pdf
 (via SVP)
--~--~-~--~~~---~--~~
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 regex implement ifn?

2009-08-29 Thread eyeris

I have the same urge, to want to use regexps as predicates. However I
definitely would not like to read such code. I can only imagine having
to try to read such code if I didn't understand regexps. E.g. (filter
#\d+ maybe-numbers) is clear enough to someone who understands
regexps. However (filter is-number-regex maybe-numbers) is clear to
even programmers that don't understand regexps.


On Aug 27, 10:41 am, Sean Devlin francoisdev...@gmail.com wrote:
 On Aug 27, 1:06 am, Timothy Pratley timothyprat...@gmail.com wrote:



   Granted, this wouldn't work for anything that gets passed to Java, but
   the following gist would be a start.
  http://gist.github.com/176032

  You already have a getPattern method for those cases. Which suggests
  another solution:

  (defn re-fn
    Uses ss to construct a java.util.Pattern.
    Returns a function which returns the Pattern if called with no
  arguments,
    and calls re-seq if called with a string argument.
    [ss]
    (let [pp (re-pattern ss)]
      (fn re
        ([] pp)
        ([s] (re-seq pp s)

  user= ((re-fn 2.) 12324251)
  (23 24 25)
  user= ((re-fn 2.))
  #2.

   If #X created a (re-fn X) then all the re functions could accept
  a function and call it in order to avoid having to do (re-find (pp)
  s). The previous signature could be retained so that they would work
  with either type of arguments if that were desirable. The downside is
  trying to explain that in the docs might be confusing - so a wrapper
  seems more obvious for that.

  Oh - it seems like re-seq does the most work so perhaps that is the
  best candidate?

 The only feature I want is the ability to use a regex as a predicate.
 So, I'd prefer something like re-matches.  Maybe this isn't the
 biggest use case, though.

 Sean



  Regards,
  Tim.
--~--~-~--~~~---~--~~
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 regex implement ifn?

2009-08-27 Thread eyeris

I named is-number-regex poorly. I meant it to be a function that calls
re-matches. Here's a more complete snippet, with better names:

; bad code
(filter #^\d+$ maybe-numbers)

; good code
(defn re-match? [re s] (not (nil? (re-matches re s
(defn number-text? [s] (re-match? #^\d+$ s))
(filter number-text? maybe-numbers)

My point is that, since magic numbers are bad, you should be giving
the regex a meaningful name, so implementing IFn for regexps isn't a
big savings because it pretty much just transforms:

(defn number-text? [s] (re-match? #^\d+$ s))

into this:

(defn number-text? [s] (#^\d+$ s))





On Aug 27, 12:50 pm, Sean Devlin francoisdev...@gmail.com wrote:
 Hmmm...  I think you're confusing the issue.  Your compliant seems to
 be more directed at magic numbers than regexes.  If I understand
 your argument (which I agree with):

 ;bad code
 (filter #\d+ maybe-numbers)

 ;good code
 (let [is-number-regex #\d+]
   (filter is-number-regex maybe-numbers))

 Granted, some understanding of regexes is required.  However, if
 you're hacking Lisp, I think you've moved beyond beginner status, and
 expecting a basic familiarity of a regex is fair.

 My $.02

 Sean

 On Aug 27, 1:37 pm, eyeris drewpvo...@gmail.com wrote:

  I have the same urge, to want to use regexps as predicates. However I
  definitely would not like to read such code. I can only imagine having
  to try to read such code if I didn't understand regexps. E.g. (filter
  #\d+ maybe-numbers) is clear enough to someone who understands
  regexps. However (filter is-number-regex maybe-numbers) is clear to
  even programmers that don't understand regexps.

  On Aug 27, 10:41 am, Sean Devlin francoisdev...@gmail.com wrote:

   On Aug 27, 1:06 am, Timothy Pratley timothyprat...@gmail.com wrote:

 Granted, this wouldn't work for anything that gets passed to Java, but
 the following gist would be a start.
http://gist.github.com/176032

You already have a getPattern method for those cases. Which suggests
another solution:

(defn re-fn
  Uses ss to construct a java.util.Pattern.
  Returns a function which returns the Pattern if called with no
arguments,
  and calls re-seq if called with a string argument.
  [ss]
  (let [pp (re-pattern ss)]
    (fn re
      ([] pp)
      ([s] (re-seq pp s)

user= ((re-fn 2.) 12324251)
(23 24 25)
user= ((re-fn 2.))
#2.

 If #X created a (re-fn X) then all the re functions could accept
a function and call it in order to avoid having to do (re-find (pp)
s). The previous signature could be retained so that they would work
with either type of arguments if that were desirable. The downside is
trying to explain that in the docs might be confusing - so a wrapper
seems more obvious for that.

Oh - it seems like re-seq does the most work so perhaps that is the
best candidate?

   The only feature I want is the ability to use a regex as a predicate.
   So, I'd prefer something like re-matches.  Maybe this isn't the
   biggest use case, though.

   Sean

Regards,
Tim.
--~--~-~--~~~---~--~~
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: Lazy Exceptions

2009-08-27 Thread eyeris

When you say the original do you mean the outer-most
RuntimeException or the inner-most exception?


On Aug 27, 8:33 am, Meikel Brandmeyer m...@kotka.de wrote:
 Hi,

 On Aug 27, 5:47 am, Tim Snyder tsnyder...@gmail.com wrote:



  I'm trying to understand how laziness affects exception handling.  I
  keep finding my exceptions wrapped in RuntimeExceptions.

  If I have code that just throws an exception, I get what I'd expect:
  (throw (Exception. Plain Exception)) --
  Plain Exception
   [thrown class java.lang.Exception]

  On the other hand if I make the exception lazy, it is always wrapped
  in a RuntimeException:
  (lazy-seq
    [(throw (Exception.
       NotPlainException))])  --
  java.lang.Exception: NotPlainException
    [Thrown class java.lang.RuntimeException]

  This of course makes it harder to deal with the exceptions.  I've
  looked through the stack traces but can't see any solution.  Is this
  due to the Java difference between checked and unchecked exceptions?
  Is there a reasonable way to work around it?  Doall has no effect.

 You can travel down the exception chain by means of .getCause. Do that
 until you find your Exception or maybe until the cause is not a
 RuntimeException anymore. If you didn't find something of concern
 rethrow the original exception. Does that make sense?

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



Re: Using a map vs. using a metadata map

2009-08-22 Thread eyeris

I favor using a map as the state because I think the information in
your example is an integral part of most parsing goals, not meta-data
retained to serve an auxiliary purpose. An example of what I would
consider meta-data for a parser would be the number of calls to
consumption functions the parser had to make before each token was
consumed. It's not used for parsing, but it would be useful for
determining the performance of your parser and possibly as debugging
information.


On Aug 21, 1:25 pm, samppi rbysam...@gmail.com wrote:
 I'm trying to make a decision in a parser library between using
 regular maps as states (containing a sequence of remaining tokens, as
 well as other info) vs. using metadata maps attached to the sequence
 of remaining tokens. In other words:

   {:remainder [\r \e \m], :index 3, :line 5, :column 2}

 vs.

   #^{:index 3, :line 5, :column 2} [\r \e \m]

 The two germane properties I can think of are accessing speed and
 equality of states in testing.

 If I do the former, then I can directly alter the index, line, and
 column. But in my tests, I have to write something like (make-state
 [\r \e \m] 3 5 2) every time. (That might be a good or bad thing; it's
 a lot more cluttered, but always explicit about what the expected
 values of the whole state are.)

 If I do the latter, then to access or alter the index, line, or
 column, I have to use 'meta or 'with-meta. Yet my tests would be a lot
 cleaner, because I wouldn't have to repeat the line or column every
 time I make a state. What I'm worried about is the speed impact that
 'meta and 'with-meta may have. Are their time effects negligible?
 Which would be better Clojure?
--~--~-~--~~~---~--~~
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: when should functions seq their arguments?

2009-07-28 Thread eyeris

It calls nth and count, both of which except a collection, according
to their docstrings.

On Jul 27, 4:46 pm, Sean Devlin francoisdev...@gmail.com wrote:
 I'm not sure if it should change.

 I think this depend on the distinction between seq and
 collection.  For example, I personally consider a string a seq, but
 not a collection.

 Is this a proper distinction?

 On Jul 27, 5:36 pm, eyeris drewpvo...@gmail.com wrote:

  The docstring should also be changed by replacing seq with
  collection.

  On Jul 27, 12:39 pm, Mark Engelberg mark.engelb...@gmail.com wrote:

   Yeah, but this case is different because nth is much faster if the
   input is a vector, and calling seq on the input will actually degrade
   the performance for vector inputs.

   Maybe you could test for vectorness, and call seq otherwise.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



What does RT stand for?

2009-07-28 Thread eyeris

I've been browsing the Clojure code. Everything seems to depend on
clojure.lang.RT. What does RT stand for?
--~--~-~--~~~---~--~~
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: What does RT stand for?

2009-07-28 Thread eyeris

That makes sense. Thanks.

On Jul 28, 1:30 pm, David Nolen dnolen.li...@gmail.com wrote:
 RunTime I believe.

 On Tue, Jul 28, 2009 at 2:29 PM, eyeris drewpvo...@gmail.com wrote:

  I've been browsing the Clojure code. Everything seems to depend on
  clojure.lang.RT. What does RT stand for?
--~--~-~--~~~---~--~~
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: when should functions seq their arguments?

2009-07-27 Thread eyeris

The docstring should also be changed by replacing seq with
collection.

On Jul 27, 12:39 pm, Mark Engelberg mark.engelb...@gmail.com wrote:
 Yeah, but this case is different because nth is much faster if the
 input is a vector, and calling seq on the input will actually degrade
 the performance for vector inputs.

 Maybe you could test for vectorness, and call seq otherwise.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Implementing ISeq

2009-07-26 Thread eyeris

I want to implement ISeq to provide a sequence over an Excel file. I
plan to implement it in Java. I see that Range extends ASeq for its
default implementation of cons() and more(). Is extending ASeq the
recommended way to implement a sequence?
--~--~-~--~~~---~--~~
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: Memory Problem

2009-07-24 Thread eyeris

On Jul 24, 6:17 am, Dragan Djuric draga...@gmail.com wrote:
 Sometimes (or maybe always?) it is mentioned in the doc. In my
 opinion, this is one of the cases where dynamic languages do not
 excel. If we had typing, that would be solved by implementing Lazy
 interface.

We do have types and we do have a lazy interface. The lazy interface
is ISeq.

--~--~-~--~~~---~--~~
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: Memory Problem

2009-07-24 Thread eyeris

Passing a collection to a function that expects a lazy seq is not
always an error. The seq library encourages it by calling (seq) on
those collections for you. I suppose all lazy functions could emit a
warning when they have to call (seq) on their arguments, based on some
global variable like *warn-on-non-lazy-seq*, similar to *warn-on-
reflection*. However, I don't have a good grasp on whether these types
of mistakes are widespread enough to warrant such a change.


On Jul 24, 10:50 am, Dragan Djuric draga...@gmail.com wrote:
 Is there an automatic way to discover such error? These types of
 errors could be discovered by the compiler. How am I going to see if I
 get an ISeq in my clojure code? I would have to dig...

 On Jul 24, 3:37 pm, eyeris drewpvo...@gmail.com wrote:

  On Jul 24, 6:17 am, Dragan Djuric draga...@gmail.com wrote:

   Sometimes (or maybe always?) it is mentioned in the doc. In my
   opinion, this is one of the cases where dynamic languages do not
   excel. If we had typing, that would be solved by implementing Lazy
   interface.

  We do have types and we do have a lazy interface. The lazy interface
  is ISeq.
--~--~-~--~~~---~--~~
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: On laziness and with-open

2009-07-09 Thread eyeris

I ran the code you pasted here. It didn't throw an IOException for me.
I am running 1.0.


On Jul 9, 5:10 am, Mike cki...@gmail.com wrote:
 I wanted to grab bytes out of a stream, and didn't see an analogue to
 reader from duck-streams, so I made my own:

 (defn byte-seq
   Returns the bytes from stream as a lazy sequence of ints.
   stream must implement java.io.InputStream.
   [#^java.io.InputStream stream]
   (lazy-seq
    (let [b  (. stream (read))]
      (if (= b 0)
        (cons b (byte-seq stream))

 Then I did a simple lazy operation on a stream of bytes, say, to drop
 the first 5:

 (with-open [st (FileInputStream. mike.clj)] (drop 5 (byte-seq st)))

 I was a little surprised at first getting java.io.IOException: Bad
 file descriptor, but of course it hit me:  the laziness persists well
 beyond the .close() in the with-open.

 I modified my byte-seq to close the stream when EOF is reached, but
 this is an awful ugly solution having the inner thing know when to
 close the outer concern's thing.  (What if the outer thing wants to
 rewind?  etc.)

 Is there a pattern out there in Clojure for handling laziness at the
 same time as handling resource lifecycle (with-open, etc.)?

 Thanks again in advance,
 Mike
--~--~-~--~~~---~--~~
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: Currying / Partial Application macro

2009-05-30 Thread eyeris

From a practical position, anonymous functions of the #(+ 5 %) flavor
*are* partial application. The ubiquity of these anonymous functions
in clojure code is evidence that partial application is just as needed
in clojure as it is in haskell. #(+ 5 %) is not much more succinct
than (\x - x + 5). However in haskell partial application is the
default; no 'partial' function or operator is needed as + 5 is the
partial application of +. In conclusion, we often need partial
application in both languages and the succinctness of expression in
each language causes practitioners to choose true partial application
versus anonymous functions. If clojure used partial application by
default, then we would see fewer anonymous functions in clojure code;
if haskell did not use partial application by default, we would see
more anonymous functions in haskell code.



On May 29, 10:40 pm, Vagif Verdi vagif.ve...@gmail.com wrote:
 On May 27, 11:57 pm, kinghajj kingh...@gmail.com wrote:

  Example:
  (def add5 ($ + 5))

  (add5 3)

 I love partial application in haskell. But do not see the need for it
 in clojure with its succinct syntax for anonymous functions:

 (def add5 #(+ 5 %1))

 (add5 3)

 Besides clojure's anonymous function syntax allows you to replace any
 argument, not just the last one, like your partial macro.
--~--~-~--~~~---~--~~
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: IFn?

2009-04-19 Thread eyeris

Generally, if you see this in a runtime exception, you tried to call
something that does not implement the IFn interface.

On Apr 18, 11:37 pm, tmountain tinymount...@gmail.com wrote:
 Sorry for the newbie question, but can someone tell me what IFn means
 exactly? I keep running into it in the docs particularly in the
 keyword documentation, and Google has yet to expain.

 Thanks,
 Travis
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Clojure group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Re: Opinions on - macro?

2009-02-28 Thread eyeris

You are wrong. Many writings use ,, as a place-holder for where - is
placing the argument. Take Meikel's example above:

(foo (bar (baz (frobnicate a-thing)) bla))

Becomes

(- a-thing frobnicate baz (bar bla) foo)

So bar is a function of more than one argument. Re-written with place-
holders it would be:

(- a-thing (frobnicate ,,) (baz ,,) (bar ,, bla) (foo ,,))

Does that make it more clear?

-Drew

On Feb 28, 9:39 pm, Joshua Fox joshuat...@gmail.com wrote:
 -  confuses me: Does it treat functions with multiple parameters different
 from functions with one parameter? Am I right that it can only be used with
 the latter?
 Joshua
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Clojure group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



How do *you* use Compojure?

2009-01-31 Thread eyeris

I'm considering implementing a small web app using Compojure. I don't
have much experience with Jetty or any other web server save Apache.

While testing Compojure, I've been using the embedded Jetty API. This
has been convenient for getting up and running quickly. However I
don't like having to restart my script each time I need to test a
change. I love the fast no-compile, no-restart development-test cycle
of Python and PHP. I've tried to get the automatic reloading feature
of Jetty working, but it seems as if that feature doesn't support
reloading the script that started the Jetty server.

If you use Compojure, how do you use it? e.g. Embedded Jetty, external
Jetty, Apache + Tomcat, etc. Has anyone been able to configure Jetty
to automatically reload Clojure files?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Clojure group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---