Re: Frustrations in being moderated

2012-03-23 Thread Mark Rathwell
>> I'm sure that some level of moderation is necessary to keep the list clean,
>> but does it have to be so draconian?
>
> Hmm, I didn't even know the list was moderated (beyond first post
> moderation which I'd assume was the norm on Google Groups). Perhaps
> Clojure/core can comment on what the actual moderation policy is? And
> maybe they can appoint some more moderators to help ease the burden?

I think it used to be 5 posts, or something like that, until you were
automatically moved to unmoderated, but that was a couple years ago.
I did have to ask Stuart H. to manually "unmoderate" me 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


Clojure meetups near Zürich

2012-03-23 Thread Thomas G. Kristensen
Hi all,

I've recently moved to Wollerau near Zürich in Switzerland. There was
a thread (about a year old) from Clojurians in the area, but it does
not seem there are any regular meetups. Are there any interested
Clojurians in the area?

Short description of myself: I'm Danish, working for a Danish
consultant firm. Here in Switzerland we develop apps for iPhone and
Android phones in Switzerland and Denmark. The backends are typically
written in Java and my long term evil plan is to introduce Clojure on
the backend.

Let me know if you want to meet up for some light hacking and interest
sharing.

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


Clojure meetups near Zürich, Italy, Europe

2012-03-23 Thread Marco Abis
Hi Thomas, Marco, all,

   a few weeks back I sent an email to every contact I could find
for all the European user groups listed here
http://dev.clojure.org/display/community/Clojure+User+Groups   to let
them know about EuroClojure in May.

I'd love to have an informal "meet the user group" kind of thing
during the conference and facilitate interaction. We are also going to
have a talk/case study about building communities :-)

Thought to let everyone know

Marco

-- 
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 meetups near Zürich, Italy, Europe

2012-03-23 Thread Meikel Brandmeyer (kotarak)
Hi Marco,

would you add me to the mix? I want to build up a users group for Frankfurt 
am Main (Germany). However, at the moment it has only one semi-active 
member, myself. Nevertheless I'd like to take part in the meet the group 
event - should it happen - to exchange experiences a bit for starting user 
groups.

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: Frustrations in being moderated

2012-03-23 Thread Stuart Sierra
The "policy" is entirely controlled by Google Groups. I think it's 
time-based.
-S

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

Re: [OT] Any other italian Clojure users?

2012-03-23 Thread Giorgio Valoti

Il giorno 22/mar/2012, alle ore 10:21, Marco Dalla Stella ha scritto:

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

Here’s one (or at least I’m trying :) ).

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

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


Re: Use metadata instead of :require-macros for requiring macros from ClojureScript?

2012-03-23 Thread Evan Mezeske

>
> In the Clojure case you extract the chunk with
>tangle mydoc "Clojure code" >file
> and in the ClojureScript case you extract it with
>tangle mydoc "ClojureScript code" >file
>
This adds an cumbersome step to the build process, adds an external 
dependency, and is exactly the kind of thing I want to avoid by using 
something like metadata to specify macro namespaces.  There are innumerable 
ways to slice up an input file so that bits of platform-specific code can 
be included in it, but that just seems so... anti-lisp.  To me it would be 
much preferable to have macros that allow for divergent platform 
implementations (e.g. (if-clj (then) (else)), etc).  I've actually started 
working on a library that provides such macros, but there's a problem: that 
very library has to be :required in a platform-specific way.  It's a bit of 
a chicken-and-egg problem that would just go away if the same ns form 
worked on both platforms.

To me, the basic problem here is that the ns macro differs between 
platforms, and there's simply no in-language way to work around it.  The 
other differences between platforms can be avoided in various ways (e.g. 
with my emezeske/prism  library), but 
since the ns macro's :require-macros option is handled magically by the 
compiler, there's just no in-language way to work around it.

Wouldn't it be nice to distribute some body of very pure algorithmic code 
that would "just work" on either Clojure or ClojureScript, even if it did 
need to use macros?

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

Re: New(er) Clojure cheatsheet hot off the presses

2012-03-23 Thread Rostislav Svoboda
Hi Andy

> If anyone has suggestions for what you would like to see added to the 
> cheatsheet

It'd be great to have a tooltip appearing at every function I go over
with my mouse. Typically I click on a function just to realize "Oh,
this is not the one I need" so I have to go back. And this back &
forth repeats several times. IMO tooltips would make such a search
much faster and smoother. (Thx in advance)

Bost

-- 
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: Use metadata instead of :require-macros for requiring macros from ClojureScript?

2012-03-23 Thread David Nolen
This needs a design page on Confluence. Anything under discussion should
probably address the new :refer.

David

On Thu, Mar 22, 2012 at 10:37 PM, Evan Mezeske  wrote:

> Oops, I accidentally posted this before I finished typing it.  I guess
> most of what I was trying to convey made it through.
>
> The second ns form I posted is my suggested approach.  It requires no
> modifications to the Clojure language, and would be pretty simple to
> implement in the ClojureScript compiler.  I'd be more than happy to
> implement such support if people thought it was desirable.
>
> -Evan
>
>
> On Tuesday, March 20, 2012 10:12:43 PM UTC-7, Evan Mezeske wrote:
>>
>> Hi,
>>
>> I'm working on some tools for making it easier to share generic Clojure
>> code between Clojure and ClojureScript, and one problem that does not seem
>> to have a pretty solution is that of requiring macros.  Clojure uses a
>> regular (:require ...) whereas ClojureScript needs a (:require-macros ...).
>>  I understand that the distinction is necessary for ClojureScript because
>> macros are written in Clojure.
>>
>> This difference in the (ns ...) form is troublesome when trying to share
>> code between the two languages.  Right now, the only solution is to
>> copy+edit the shared file (possibly with an automated tool) so that it has
>> :require and :require-macros as appropriate.  This is not very pretty.
>>
>> So that gets me to wondering, has anyone brought up the idea of using
>> metadata to identify macro namespaces?  So instead of using
>> :require-macros, :require would be used, but each namespace identifier
>> would be inspected to see if it had ^{:macros true}.
>>
>>
>> ; The existing way to require macros from ClojureScript:
>>
>> (ns example.shared
>>   (:require-macros
>> [example.macros :as macros])
>>   (:require
>> [example.other :as other]))
>>
>>
>>
>> (ns example.shared
>>   (:require
>> ^:macros [example.macros :as macros]
>> [example.other :as other]))
>>
>>  --
> 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: Frustrations in being moderated

2012-03-23 Thread Stuart Halloway
> The "policy" is entirely controlled by Google Groups. I think it's time-based.
> -S


It can also be overridden per user, once you find your way through the 
confusing groups API.

Evan, you should be unmoderated now.

Stu

Stuart Halloway
Clojure/core
http://clojure.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: ClojureScript: how to get rid of "no longer a property access" warning

2012-03-23 Thread Stuart Sierra
It is done.

"And there was much rejoicing."

-S

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

[beginner] library for java code generation

2012-03-23 Thread Alex Shabanov
Hi all,

Is there any easy-to-use library for generating java code?
I ended up writing simple function that takes strings and characters
and prints them in formatted form (e.g. with tabs and newlines after
braces).
I really like compojure approach to build html page - is there any
similar libraries exist for arbitrary code generation?

P.S.: my approach to code generation is as follows:

;; ==
;; fail function just throws exception

(def tab-count (ref 0))
(def was-newline (ref false))
(def tab-unit "")


(defn pgf-reset
  "Resets printing facility"
  {:static true}
  []
  (ref-set tab-count 0)
  (ref-set was-newline false))


(defn pgf
  "Printing facility for java programming language"
  {:static true}
  [& more]
  (letfn [(align []
(let [aligned @was-newline]
  (if aligned (print (apply str (repeat @tab-count tab-
unit
  (ref-set was-newline false)
  aligned))
  (align-and-print [val]
(align)
(print val))
  (put-newline []
(print \newline)
(ref-set was-newline true))]
(doseq [elem more]
  (cond
(char? elem) (do
   ;; update tab-count
   (cond
 (= elem \tab) (fail "Tab is auto-applied
hence unexpected in " more)
 (= elem \newline) (put-newline)
 (= elem \{) (do
   ;; print space before open
block if it isn't first in line
   (if-not (align) (print \space))
   (ref-set tab-count (inc @tab-
count))
   (print \{)
   (put-newline))
 (= elem \}) (do
   (ref-set tab-count (dec @tab-
count))
   ;; validate tab-count
   (if (< @tab-count 0) (fail
"While printing " more ", tab-count=" @tab-count))
   ;; align, print '\{' and
newline
   (align-and-print \})
   (put-newline))
 ;; just print element itself
 :else (align-and-print elem)))
(string? elem) (align-and-print elem)
(number? elem) (align-and-print (str elem)) ;; TODO: java-
specific conversion should go here
(symbol? elem) (align-and-print (str elem))
:else (fail "Don't know how to print " elem)



#_(dosync
(pgf-reset)
(pgf "class Foo" \{
"public static void main(String[] args)" \{
  "System.out.println(" \" "Hello, world!" \" ");" \newline
\}
  \})
nil)
;; ==

I personally don't like it for (1) side effects and (2) using outer
variables, but the other approaches I came up with seem to me to be
more verbose/inelegant.
Constructive criticism is greatly appreciated.

-- 
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: Frustrations in being moderated

2012-03-23 Thread Softaddicts
And maybe in the wrong thread ? :)))


> 
> Whoops, submitted that a bit too soon.
> 
> I guess only couple of things to add:
> 
> (1)  The cost of obtaining the primitive array and returning it to the
> cache is likely no worse than operations on an ArrayList, so those
> should be very cheap.
> 
> (2)  The cost of coercing the primitive to a java.lang.Number is
> likely no worse than the cost of standard Java boxing.
> 
> What do people think?  Those of you familiar with the Clojure
> compiler, does this approach make sense?
> 
> On Aug 4, 8:02 am, Mark Addleman  wrote:
> > I think there may be a somewhat straightforward solution to improving
> > Clojure's performance when passing primitives between functions.
> > Here's my understanding of the problem:  The IFn interface is a series
> > of invoke method signatures that take a number of java.lang.Objects as
> > parameters and returns a java.lang.Object.  Primitives can't be passed
> > this way and it would be a silly explosion of code to create the
> > methods signatures in IFn that included primitives.  The performance
> > characteristcs of "boxing" primitives relies on the JVM's performance
> > of allocating and deallocating objects.
> >
> > My analysis:  The JVM is awfully good at handling transient objects
> > like the ones used for boxing, but no matter how good it is, it's
> > always better if the work needn't be done in the first place.
> >
> > Here's my notion (bordering on brain fart):  Clojure does its own
> > primitive boxing using one element arrays.  Each thread has a
> > dynamically growable threadlocal cache of one-element arrays for each
> > primitive that needs to pass through the stack.  At the call site, the
> > compiler generates code to "allocate" the one element array
> > threadlocal of the appropriate type and stuffs the primitive into the
> > array.  Since the array itself is a java.lang.Object, it can pass
> > through the IFn interface without a problem.  At the target site, it
> > gets a bit more tricky.  If the object is type-coerced to a primitive,
> > it's simply a matter of pulling the first (and only) element out of
> > the array.  If the object is treated as a java.lang.Number, Clojure
> > must create the correct java object on the fly.  I don't think this
> > logic is very hard, but I can see how it might get tricky and have
> > lots of cases depending on how the compiler is designed.
> >
> > Once the threadlocal cache is of sufficient size (I *think* the
> > largest it ever needs to grow is the largest number of primitives in
> > any method signature), the boxing costs fall into two categories:  In
> > the case where the object is coerced to a primitive, no tax is placed
> > on the garbage collector.  The cost is obtaining an available
> > primitive array, stuffing the primtive into the array, reading the
> > primitive out of the array and putting the array back into the cache.
> > This should be substantially faster than standard Java boxing.  In the
> > case where the object is treated as a java.lang.Number, the cost is
> > obtaining an available primitive array, stuffing the primtive into the
> > array, constructing the appropriate object and returning the the array
> > to the cache.
> --~--~-~--~~~---~--~~
> 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
> -~--~~~~--~~--~--~---
> 
> 
> 
--
Softaddicts sent by ibisMail!

-- 
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: removing a hash-map from a set using hash-map's field.

2012-03-23 Thread Jay Fields
Disclaimer, I'm only looking at how I would want to write it. You may
need to do something else if you have specific performance
requirements.

clojure.set is probably your friend.

user=> (def xrel #{{:id 1, :foo "bar"} {:id 2, :foo "car"} {:id 3, :foo "dog"}})
#'user/xrel
user=> (use 'clojure.set)
nil
user=> (select (fn [{:keys [id]}] (not= id 1)) xrel)
#{{:id 2, :foo "car"} {:id 3, :foo "dog"}}

or, if this is something you do often enough

user=> (def xrel #{{:id 1, :foo "bar"} {:id 2, :foo "car"} {:id 3, :foo "dog"}})
#'user/xrel

user=> (use 'clojure.set)
nil

user=> (require 'clojure.data)
nil

user=> (defn submap [sub super]
  (->
(clojure.data/diff sub super)
last
(= sub)))
#'user/submap

user=> (select (partial (complement submap) {:id 1}) xrel)
#{{:foo "car", :id 2} {:foo "dog", :id 3}}


On Fri, Mar 23, 2012 at 2:50 AM, Philip Potter
 wrote:
> Might it be possible to use a map instead? Maps are designed to look values
> up by a key which may differ from the value, which seems to be your use case
> here.
>
> If you have
>
> {1 {:id 1, :foo "bar"},
>
>
> 2 {:id 2, :foo "car"}}
>
> You can just do
>
> (disj my-map 2)
>
> To convert the original set into a map, you could do something like:
>
> (into {} (map (juxt :id identity) my-set))
>
> Phil
>
> On Mar 23, 2012 2:59 AM, "Leandro Oliveira"  wrote:
>>
>> Hi all,
>>
>> I have a set of hash like this:
>>
>> #{{:id 1, :foo "bar"} {:id 2, :foo "car"}}
>>
>> and I'd like to remove an item based on its id value.
>>
>> Unfortunately, disj requires that I pass the whole map as key to remove
>> it.
>>
>> Can I remove the map from the set only using the id?
>>
>> My intention is to avoid a lookup on set to get the whole map back.
>>
>> Any suggestions?
>>
>>
>> Thanks in advance.
>> leandro.
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clojure@googlegroups.com
>> Note that posts from new members are moderated - please be patient with
>> your first post.
>> To unsubscribe from this group, send email to
>> clojure+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with your
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en

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


Re: [beginner] library for java code generation

2012-03-23 Thread Tassilo Horn
Hi Alex,

I've done similar things in the past, also by throwing together plain
strings and using `format` as a kind of templating thingy.  I don't even
think it's a too bad approach.

With respect to the side-effects: you can omit all of them (glancing at
your code) by giving up the indentation.  There's no reason to do any
formatting in languages where indentation has no meaning.  Spit out one
large line or a bunch of unindented lines and use a tool like `astyle`
or the eclipse code formatter for making it pretty.

Bye,
Tassilo

-- 
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: revisiting community funding?

2012-03-23 Thread cej38
I am willing to contribute, and have in the past, but I think that
instead of just contributing some cash and hoping things that we want
will be worked on, I would propose that we structure it some.  In
fact, I come up with a few projects that could be of use to the whole
community, or at least a large subset of the community.  The clojure/
core team could determine how much time that they think it will take
to finish a project (or at least make real progress), and then have a
fundraising goal for that project.  It would be kinda like we are
hiring them to work on the projects that we want to see finished.

A few ideas of topics:
clojure-in-clojure
a standard IO API that different VM implementations support
Liebke's map/reduce
fleshing out clojure.contrib libraries to bring them back to par with
contrib 1.2 (a standard API page like what was had through
clojure.contrib 1.2 would be REALLY awsome)
faster numerics

-- 
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: [beginner] library for java code generation

2012-03-23 Thread Herwig Hochleitner
Take a look at https://github.com/stathissideris/javamatic

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


Re: New(er) Clojure cheatsheet hot off the presses

2012-03-23 Thread Andy Fingerhut
I definitely like the tooltip idea.  I like it so much that I've already played 
with it a bit, looking at several web pages with instructions for how to do it, 
but my knowledge of good ways to do this is zero except for the results of 
those Google searches.

Has anyone implemented tooltips on a web page?  My preferences for a solution 
are:

(a) No interaction with the web server required to get the tooltip contents, 
i.e. as far as the server is concerned, it is a static file web page.  
Hopefully this means it has a very fast reaction time when the user interacts 
with it to show or take down the tooltips.

(b) Tooltips always appear within the browser window, never sometimes partially 
in it and partially outside it.

(c) Tooltips appear while your mouse is hovered over a link, and disappear as 
soon as the mouse moves away from that link.

(d) works with most current web browsers (e.g. latest Firefox, Chrome, Safari, 
IE).

(e) No $$ or legal encumbrances to use it.

Thanks,
Andy

On Mar 23, 2012, at 3:45 AM, Rostislav Svoboda wrote:

> Hi Andy
> 
>> If anyone has suggestions for what you would like to see added to the 
>> cheatsheet
> 
> It'd be great to have a tooltip appearing at every function I go over
> with my mouse. Typically I click on a function just to realize "Oh,
> this is not the one I need" so I have to go back. And this back &
> forth repeats several times. IMO tooltips would make such a search
> much faster and smoother. (Thx in advance)
> 
> Bost
> 
> -- 
> 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: New(er) Clojure cheatsheet hot off the presses

2012-03-23 Thread László Török
Hi,

I think Twitter's Bootstrap toolkit is sg to consider.

http://twitter.github.com/bootstrap/javascript.html#tooltips

also

http://twitter.github.com/bootstrap/javascript.html#popovers

I already used them, they're easy and fun to implement. :)
I think if the content already appers somewhere on the page, you can simply
reference it using it's element id.
hope it helps
Las

2012/3/23 Andy Fingerhut 

> I definitely like the tooltip idea.  I like it so much that I've already
> played with it a bit, looking at several web pages with instructions for
> how to do it, but my knowledge of good ways to do this is zero except for
> the results of those Google searches.
>
> Has anyone implemented tooltips on a web page?  My preferences for a
> solution are:
>
> (a) No interaction with the web server required to get the tooltip
> contents, i.e. as far as the server is concerned, it is a static file web
> page.  Hopefully this means it has a very fast reaction time when the user
> interacts with it to show or take down the tooltips.
>
> (b) Tooltips always appear within the browser window, never sometimes
> partially in it and partially outside it.
>
> (c) Tooltips appear while your mouse is hovered over a link, and disappear
> as soon as the mouse moves away from that link.
>
> (d) works with most current web browsers (e.g. latest Firefox, Chrome,
> Safari, IE).
>
> (e) No $$ or legal encumbrances to use it.
>
> Thanks,
> Andy
>
> On Mar 23, 2012, at 3:45 AM, Rostislav Svoboda wrote:
>
> > Hi Andy
> >
> >> If anyone has suggestions for what you would like to see added to the
> cheatsheet
> >
> > It'd be great to have a tooltip appearing at every function I go over
> > with my mouse. Typically I click on a function just to realize "Oh,
> > this is not the one I need" so I have to go back. And this back &
> > forth repeats several times. IMO tooltips would make such a search
> > much faster and smoother. (Thx in advance)
> >
> > Bost
> >
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Clojure" group.
> > To post to this group, send email to clojure@googlegroups.com
> > Note that posts from new members are moderated - please be patient with
> your first post.
> > To unsubscribe from this group, send email to
> > clojure+unsubscr...@googlegroups.com
> > For more options, visit this group at
> > http://groups.google.com/group/clojure?hl=en
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en




-- 
László Török

-- 
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: [beginner] library for java code generation

2012-03-23 Thread Ben Smith-Mannschott
On Fri, Mar 23, 2012 at 14:22, Alex Shabanov  wrote:
> Hi all,
>
> Is there any easy-to-use library for generating java code?
> I ended up writing simple function that takes strings and characters
> and prints them in formatted form (e.g. with tabs and newlines after
> braces).
> I really like compojure approach to build html page - is there any
> similar libraries exist for arbitrary code generation?

I've also looked for, but not found such a library.

I wrote a tool in Clojure which generates Java 5 enumerations from
data. The templating solution I settled on was to do this:

A template is a function which returns a template-result.
A template-result is a sequence of atoms and template-results.
An atom is a string, number, boolean, java.lang.Class, keyword, symbol or nil.

The result of running my code generator is thus a tree of atoms, which
I then flatten, remove the nils, and then convert the atoms:
- strings are just themselves
- keywords and symbols are their names
- java.lang.Class objects are the fully qualified name of the class
- booleans and numbers become java literals
Then concatenate the resulting strings.

It's odd, but it works, and has the advantage that templates
(functions) need not have side-effects and can be composed in
interesting ways.

e.g. (rough sketch):

(defn declare-field [name value]
  ["public final " (unbox (class value)) " " name " = " value ";"])

(defn declare-fields [name-val]
  (interpose "\n"
(map delare-field (keys name-val) (vals name-val

(template-result->string
  (declare-fields {:aNumber 1, :aBoolean false}))

Would produce something like:

  public final long aNumber = 1;
  public final boolean aBoolean = false;

This works OK for me, but it's really just a step up from raw printfs.
It doesn't understand anything about java syntax, so, handling
indentation -- for example -- is ad-hoc and brittle.

// ben

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


Re: New(er) Clojure cheatsheet hot off the presses

2012-03-23 Thread Jordan Berg
It would be straightforward in clojurescript as well.  Google provides a
bunch of different tooltips in the closure library:

http://closure-library.googlecode.com/svn/docs/class_goog_ui_Tooltip.html

http://closure-library.googlecode.com/svn/docs/class_goog_ui_AdvancedTooltip.html

http://closure-library.googlecode.com/svn/docs/class_goog_ui_HoverCard.html


You can always edit the default CSS to make them look less...crappy

Cheers,

Jordan


On Fri, Mar 23, 2012 at 11:18 AM, László Török  wrote:

> Hi,
>
> I think Twitter's Bootstrap toolkit is sg to consider.
>
> http://twitter.github.com/bootstrap/javascript.html#tooltips
>
> also
>
> http://twitter.github.com/bootstrap/javascript.html#popovers
>
> I already used them, they're easy and fun to implement. :)
> I think if the content already appers somewhere on the page, you can
> simply reference it using it's element id.
> hope it helps
> Las
>
> 2012/3/23 Andy Fingerhut 
>
>> I definitely like the tooltip idea.  I like it so much that I've already
>> played with it a bit, looking at several web pages with instructions for
>> how to do it, but my knowledge of good ways to do this is zero except for
>> the results of those Google searches.
>>
>> Has anyone implemented tooltips on a web page?  My preferences for a
>> solution are:
>>
>> (a) No interaction with the web server required to get the tooltip
>> contents, i.e. as far as the server is concerned, it is a static file web
>> page.  Hopefully this means it has a very fast reaction time when the user
>> interacts with it to show or take down the tooltips.
>>
>> (b) Tooltips always appear within the browser window, never sometimes
>> partially in it and partially outside it.
>>
>> (c) Tooltips appear while your mouse is hovered over a link, and
>> disappear as soon as the mouse moves away from that link.
>>
>> (d) works with most current web browsers (e.g. latest Firefox, Chrome,
>> Safari, IE).
>>
>> (e) No $$ or legal encumbrances to use it.
>>
>> Thanks,
>> Andy
>>
>> On Mar 23, 2012, at 3:45 AM, Rostislav Svoboda wrote:
>>
>> > Hi Andy
>> >
>> >> If anyone has suggestions for what you would like to see added to the
>> cheatsheet
>> >
>> > It'd be great to have a tooltip appearing at every function I go over
>> > with my mouse. Typically I click on a function just to realize "Oh,
>> > this is not the one I need" so I have to go back. And this back &
>> > forth repeats several times. IMO tooltips would make such a search
>> > much faster and smoother. (Thx in advance)
>> >
>> > Bost
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups "Clojure" group.
>> > To post to this group, send email to clojure@googlegroups.com
>> > Note that posts from new members are moderated - please be patient with
>> your first post.
>> > To unsubscribe from this group, send email to
>> > clojure+unsubscr...@googlegroups.com
>> > For more options, visit this group at
>> > http://groups.google.com/group/clojure?hl=en
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clojure@googlegroups.com
>> Note that posts from new members are moderated - please be patient with
>> your first post.
>> To unsubscribe from this group, send email to
>> clojure+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>
>
>
>
> --
> László Török
>
>  --
> 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: Any other italian Clojure users?

2012-03-23 Thread Alessio Stalla
On Mar 23, 9:01 am, Giorgio Valoti  wrote:
> Il giorno 22/mar/2012, alle ore 10:21, Marco Dalla Stella ha scritto:
>
> > Hi,
>
> > I just want to know if there are any other italian Clojure users in
> > the ml, maybe for open an Italian Clojure User Group and organize some
> > meetings...
>
> Here’s one (or at least I’m trying :) ).
>

I'm not a Clojure user, but a Lisp + JVM user nevertheless, and I'm
really interested in hearing other people's opinions and experiences
with Clojure!

Alessio

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


Re: [OT] Any other italian Clojure users?

2012-03-23 Thread Simone Mosciatti
im italian but now im living in USA...
I will come back in july...
Im from Siena

Il giorno giovedì 22 marzo 2012 04:21:02 UTC-5, Marco Dalla Stella ha 
scritto:
>
> Hi,
>
> I just want to know if there are any other italian Clojure users in
> the ml, maybe for open an Italian Clojure User Group and organize some
> meetings...
>
> Thanks,
> -- 
> Marco Dalla Stella
> web: http://thediracsea.org
> twitter: http://twitter.com/kra1iz3c
>
>
Il giorno giovedì 22 marzo 2012 04:21:02 UTC-5, Marco Dalla Stella ha 
scritto:
>
> Hi,
>
> I just want to know if there are any other italian Clojure users in
> the ml, maybe for open an Italian Clojure User Group and organize some
> meetings...
>
> Thanks,
> -- 
> Marco Dalla Stella
> web: http://thediracsea.org
> twitter: http://twitter.com/kra1iz3c
>
>
Il giorno giovedì 22 marzo 2012 04:21:02 UTC-5, Marco Dalla Stella ha 
scritto:
>
> Hi,
>
> I just want to know if there are any other italian Clojure users in
> the ml, maybe for open an Italian Clojure User Group and organize some
> meetings...
>
> Thanks,
> -- 
> Marco Dalla Stella
> web: http://thediracsea.org
> twitter: http://twitter.com/kra1iz3c
>
>
Il giorno giovedì 22 marzo 2012 04:21:02 UTC-5, Marco Dalla Stella ha 
scritto:
>
> Hi,
>
> I just want to know if there are any other italian Clojure users in
> the ml, maybe for open an Italian Clojure User Group and organize some
> meetings...
>
> Thanks,
> -- 
> Marco Dalla Stella
> web: http://thediracsea.org
> twitter: http://twitter.com/kra1iz3c
>
>
Il giorno giovedì 22 marzo 2012 04:21:02 UTC-5, Marco Dalla Stella ha 
scritto:
>
> Hi,
>
> I just want to know if there are any other italian Clojure users in
> the ml, maybe for open an Italian Clojure User Group and organize some
> meetings...
>
> Thanks,
> -- 
> Marco Dalla Stella
> web: http://thediracsea.org
> twitter: http://twitter.com/kra1iz3c
>
>

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

Re: newbie struggling with Clooj and jars

2012-03-23 Thread TI Explorer vet
On Thursday, March 22, 2012 11:06:27 PM UTC-3, Moritz Ulrich wrote:
>
> The whole thing works in leiningen because it loads all necessary
> dependencies for you.
>
> I highly recommend to use leiningen for all dependency management,
> don't copy jars around. A quick look at the readme of Clooj reveals
> that it somehow supports leiningen :)
>
Thank you, your answer makes sense.  Scrutiny of the Clooj readme reveals "you 
are encouraged to use one of these [leiningen, cake] from the command line 
in conjunction with the clooj editor."  I don't see how, though.  I've run 
"lein deps" at the command line, and it makes satisfying noises, but it 
doesn't improve my ability to write code in Clooj.  Does this mean I can't 
write code incrementally in Clooj unless it has no dependencies?

-- 
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: removing a hash-map from a set using hash-map's field.

2012-03-23 Thread Leandro Oliveira
Thank you for all replies.

The reason that I was using set instead of map was to use the functions
from closure.set. I like them.

But now I agree that map is a better approach.

(select (fn [{:keys [id]}] (not= id 1)) xrel) is O(n). Right?

Can I say that if you need remove an item you should use a map?

What sets are good for?

leandro.


On Fri, Mar 23, 2012 at 10:37 AM, Jay Fields  wrote:

> Disclaimer, I'm only looking at how I would want to write it. You may
> need to do something else if you have specific performance
> requirements.
>
> clojure.set is probably your friend.
>
> user=> (def xrel #{{:id 1, :foo "bar"} {:id 2, :foo "car"} {:id 3, :foo
> "dog"}})
> #'user/xrel
> user=> (use 'clojure.set)
> nil
> user=> (select (fn [{:keys [id]}] (not= id 1)) xrel)
> #{{:id 2, :foo "car"} {:id 3, :foo "dog"}}
>
> or, if this is something you do often enough
>
> user=> (def xrel #{{:id 1, :foo "bar"} {:id 2, :foo "car"} {:id 3, :foo
> "dog"}})
> #'user/xrel
>
> user=> (use 'clojure.set)
> nil
>
> user=> (require 'clojure.data)
> nil
>
> user=> (defn submap [sub super]
>  (->
>(clojure.data/diff sub super)
>last
>(= sub)))
> #'user/submap
>
> user=> (select (partial (complement submap) {:id 1}) xrel)
> #{{:foo "car", :id 2} {:foo "dog", :id 3}}
>
>
> On Fri, Mar 23, 2012 at 2:50 AM, Philip Potter
>  wrote:
> > Might it be possible to use a map instead? Maps are designed to look
> values
> > up by a key which may differ from the value, which seems to be your use
> case
> > here.
> >
> > If you have
> >
> > {1 {:id 1, :foo "bar"},
> >
> >
> > 2 {:id 2, :foo "car"}}
> >
> > You can just do
> >
> > (disj my-map 2)
> >
> > To convert the original set into a map, you could do something like:
> >
> > (into {} (map (juxt :id identity) my-set))
> >
> > Phil
> >
> > On Mar 23, 2012 2:59 AM, "Leandro Oliveira"  wrote:
> >>
> >> Hi all,
> >>
> >> I have a set of hash like this:
> >>
> >> #{{:id 1, :foo "bar"} {:id 2, :foo "car"}}
> >>
> >> and I'd like to remove an item based on its id value.
> >>
> >> Unfortunately, disj requires that I pass the whole map as key to remove
> >> it.
> >>
> >> Can I remove the map from the set only using the id?
> >>
> >> My intention is to avoid a lookup on set to get the whole map back.
> >>
> >> Any suggestions?
> >>
> >>
> >> Thanks in advance.
> >> leandro.
> >>
> >> --
> >> You received this message because you are subscribed to the Google
> >> Groups "Clojure" group.
> >> To post to this group, send email to clojure@googlegroups.com
> >> Note that posts from new members are moderated - please be patient with
> >> your first post.
> >> To unsubscribe from this group, send email to
> >> clojure+unsubscr...@googlegroups.com
> >> For more options, visit this group at
> >> http://groups.google.com/group/clojure?hl=en
> >
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Clojure" group.
> > To post to this group, send email to clojure@googlegroups.com
> > Note that posts from new members are moderated - please be patient with
> your
> > first post.
> > To unsubscribe from this group, send email to
> > clojure+unsubscr...@googlegroups.com
> > For more options, visit this group at
> > http://groups.google.com/group/clojure?hl=en
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
>

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

Has anyone solved the zebra/einstein puzzle using core.logic?

2012-03-23 Thread Jim - FooBar();

Hi everyone,

I 've been trying for the past couple of days to formulate the zebra 
puzzle in clojure as an exercise to get my  head round core.logic...I 
can't seem to do it properly and so i was wondering if anyone can 
provide a well commented solution so i can study it thorougly. I know 
David Nolen has solved it (says so on core.logic github page) but i'd 
expect his solution to be very elaborate/optimized rather than simple 
(he's a logic-guru whereas i'm a logic-newbie)...I only need this for 
studying so the simpler the better!


Thanks in advance...

Jim

p.s: If someone thinks that the zebra puzzle is too complicated as a 
first example please don't hesitate to say so...I recently purchased 
"the reasoned schemer" (hasn't arrived yet) which hopefully explains 
things at a good pace.


--
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: Has anyone solved the zebra/einstein puzzle using core.logic?

2012-03-23 Thread Daniel Gagnon
>
>
> p.s: If someone thinks that the zebra puzzle is too complicated as a first
> example please don't hesitate to say so...I recently purchased "the
> reasoned schemer" (hasn't arrived yet) which hopefully explains things at a
> good pace.
>
>
It's actually pretty simple. Take a look at the Prolog version:
http://en.literateprograms.org/Zebra_Puzzle_(Prolog)

-- 
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: Has anyone solved the zebra/einstein puzzle using core.logic?

2012-03-23 Thread Jim - FooBar();
aaa ok i see...so i'm supposed to pivot around house and NOT around 
person as i was trying to...thanks for the link - very much appreciated!


Jim


On 23/03/12 17:43, Daniel Gagnon wrote:



p.s: If someone thinks that the zebra puzzle is too complicated as
a first example please don't hesitate to say so...I recently
purchased "the reasoned schemer" (hasn't arrived yet) which
hopefully explains things at a good pace.


It's actually pretty simple. Take a look at the Prolog version: 
http://en.literateprograms.org/Zebra_Puzzle_(Prolog) 



--
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: Frustrations in being moderated

2012-03-23 Thread Evan Mezeske
Thanks a bunch!

-Evan

On Friday, March 23, 2012 6:22:12 AM UTC-7, stuart@gmail.com wrote:
>
> The "policy" is entirely controlled by Google Groups. I think it's 
> time-based.
> -S
>
>
> It can also be overridden per user, once you find your way through the 
> confusing groups API.
>
> Evan, you should be unmoderated now.
>
> Stu
>
> Stuart Halloway
> Clojure/core
> http://clojure.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: removing a hash-map from a set using hash-map's field.

2012-03-23 Thread Andy Fingerhut
Sets are good when you have a collection of things, the precise order isn't 
important to you, and you want to avoid duplicates.  I used one in some code 
recently where I wanted to maintain a collection of people who were co-authors 
in a Clojure patch, and the input file I started with could mention the same 
person's name multiple times.  I only wanted each person to be included once, 
no matter how many times they were mentioned in the patch file, and I didn't 
care about the order they appeared.

Sets are also a nice way to take another Clojure collection and eliminate 
duplicates -- just call (set coll) on the collection or sequence.

I haven't used them before, but if you want to avoid duplicates, and care about 
the order, sorted-set can be useful in some situations.

Andy

On Mar 23, 2012, at 7:47 AM, Leandro Oliveira wrote:

> Thank you for all replies.
> 
> The reason that I was using set instead of map was to use the functions from 
> closure.set. I like them.
> 
> But now I agree that map is a better approach. 
> 
> (select (fn [{:keys [id]}] (not= id 1)) xrel) is O(n). Right?
> 
> Can I say that if you need remove an item you should use a map?
> 
> What sets are good for?
> 
> leandro.

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


Re: New(er) Clojure cheatsheet hot off the presses

2012-03-23 Thread Cedric Greevey
On Fri, Mar 23, 2012 at 10:58 AM, Andy Fingerhut
 wrote:
> I definitely like the tooltip idea.  I like it so much that I've already 
> played with it a bit, looking at several web pages with instructions for how 
> to do it, but my knowledge of good ways to do this is zero except for the 
> results of those Google searches.
>
> Has anyone implemented tooltips on a web page?  My preferences for a solution 
> are:
>
> (a) No interaction with the web server required to get the tooltip contents, 
> i.e. as far as the server is concerned, it is a static file web page.  
> Hopefully this means it has a very fast reaction time when the user interacts 
> with it to show or take down the tooltips.
>
> (b) Tooltips always appear within the browser window, never sometimes 
> partially in it and partially outside it.
>
> (c) Tooltips appear while your mouse is hovered over a link, and disappear as 
> soon as the mouse moves away from that link.
>
> (d) works with most current web browsers (e.g. latest Firefox, Chrome, 
> Safari, IE).
>
> (e) No $$ or legal encumbrances to use it.

Without even messing around with JS, let alone AJAX or other stuff
that involves trips to the server for more data, you can give tooltips
to links and images with plain HTML:

link text here


In text-mode browsers, if anyone still uses such things, the images
will additionally show as their tooltip texts rather than just the
opaque and useless placeholder text "[IMAGE]".

-- 
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: library for java code generation

2012-03-23 Thread Alex Shabanov


On Mar 23, 5:44 pm, Herwig Hochleitner  wrote:
> Take a look athttps://github.com/stathissideris/javamatic

hmm, interesting.

I also found quite intriguing library - http://code.google.com/p/cl-dcf/
- "a framework for building DSL compilers", though its written in
common lisp.

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


Re: New(er) Clojure cheatsheet hot off the presses

2012-03-23 Thread Andy Fingerhut
Thanks for the suggestions, folks.

Cedric, have you tried your method before?  I'm not sure, but I think it
was the thing that I tried that led me to add (b) to my list of
preference.  I like anything that makes the development job easier, but not
if it violates that preference.

Thanks,
Andy

On Fri, Mar 23, 2012 at 12:50 PM, Cedric Greevey  wrote:

> On Fri, Mar 23, 2012 at 10:58 AM, Andy Fingerhut
>  wrote:
> > I definitely like the tooltip idea.  I like it so much that I've already
> played with it a bit, looking at several web pages with instructions for
> how to do it, but my knowledge of good ways to do this is zero except for
> the results of those Google searches.
> >
> > Has anyone implemented tooltips on a web page?  My preferences for a
> solution are:
> >
> > (a) No interaction with the web server required to get the tooltip
> contents, i.e. as far as the server is concerned, it is a static file web
> page.  Hopefully this means it has a very fast reaction time when the user
> interacts with it to show or take down the tooltips.
> >
> > (b) Tooltips always appear within the browser window, never sometimes
> partially in it and partially outside it.
> >
> > (c) Tooltips appear while your mouse is hovered over a link, and
> disappear as soon as the mouse moves away from that link.
> >
> > (d) works with most current web browsers (e.g. latest Firefox, Chrome,
> Safari, IE).
> >
> > (e) No $$ or legal encumbrances to use it.
>
> Without even messing around with JS, let alone AJAX or other stuff
> that involves trips to the server for more data, you can give tooltips
> to links and images with plain HTML:
>
> link text here
> 
>
> In text-mode browsers, if anyone still uses such things, the images
> will additionally show as their tooltip texts rather than just the
> opaque and useless placeholder text "[IMAGE]".
>

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

Re: New(er) Clojure cheatsheet hot off the presses

2012-03-23 Thread Cedric Greevey
On Fri, Mar 23, 2012 at 3:57 PM, Andy Fingerhut
 wrote:
> Thanks for the suggestions, folks.
>
> Cedric, have you tried your method before?  I'm not sure, but I think it was
> the thing that I tried that led me to add (b) to my list of preference.  I
> like anything that makes the development job easier, but not if it violates
> that preference.

The tooltip could, in principle, extend beyond the browser window, but
the link would have to be at the far right edge of the window, the
text would have to be long or the pointer would have to be near the
right edge of the link, AND the browser window would have to,
bizarrely, not be maximized.

In particular, if you fear that the tooltip would extend beyond the
screen edge so half of it wasn't displayed at all, that won't happen
-- at least, not in Firefox.

The last time I saw it the cheat sheet's main content occupied a
vertical strip with fairly wide margins left and right. Unless you're
putting the full text of the Declaration of Independence into one of
the tooltips I don't see there being much likelihood of a problem
there.

Furthermore, eschewing standard tooltips and using JS or something to
roll your own would likely render the tooltips inaccessible (or worse,
confusing) with screen-reader software for the visually impaired.

-- 
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 struggling with Clooj and jars

2012-03-23 Thread Lee Spector

To use leiningen in conjunction with clooj:

1. Edit project.clj to reflect your dependencies (using clooj or whatever other 
editor).

2. Run "lein deps" from the command line within the project's directory.

3. Quit/restart clooj, since it builds its classpath on launch.

Works for me at least.

 -Lee


On Mar 23, 2012, at 1:10 PM, TI Explorer vet wrote:
> 
> Thank you, your answer makes sense.  Scrutiny of the Clooj readme reveals 
> "you are encouraged to use one of these [leiningen, cake] from the command 
> line in conjunction with the clooj editor."  I don't see how, though.  I've 
> run "lein deps" at the command line, and it makes satisfying noises, but it 
> doesn't improve my ability to write code in Clooj.  Does this mean I can't 
> write code incrementally in Clooj unless it has no dependencies?

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


Re: New(er) Clojure cheatsheet hot off the presses

2012-03-23 Thread Andy Fingerhut
I'm not putting the Declaration of Independence in the tooltips, but the
Clojure doc strings,
with the same text width as they appear in the original, which is nearly 80
characters wide.  Those are easily wide enough to go partially out of the
browser window unless the browser takes pains not to do so, and my earlier
experiments suggest they do not, or at least one of Firefox and Safari
doesn't.

It may be straightforward to generate two different tooltip-enabled version
of the cheatsheet: one for the standards-devout, and one for those who want
something that looks visually nice today, and users can pick the one they
want to use (oh, and a third that has no tooltips at all, like today's
version, in case they find them too distracting).  I'm not feeling
especially energetic about getting browser developers to change how they
implement these things.

Andy


On Fri, Mar 23, 2012 at 1:11 PM, Cedric Greevey  wrote:

> On Fri, Mar 23, 2012 at 3:57 PM, Andy Fingerhut
>  wrote:
> > Thanks for the suggestions, folks.
> >
> > Cedric, have you tried your method before?  I'm not sure, but I think it
> was
> > the thing that I tried that led me to add (b) to my list of preference.
> I
> > like anything that makes the development job easier, but not if it
> violates
> > that preference.
>
> The tooltip could, in principle, extend beyond the browser window, but
> the link would have to be at the far right edge of the window, the
> text would have to be long or the pointer would have to be near the
> right edge of the link, AND the browser window would have to,
> bizarrely, not be maximized.
>
> In particular, if you fear that the tooltip would extend beyond the
> screen edge so half of it wasn't displayed at all, that won't happen
> -- at least, not in Firefox.
>
> The last time I saw it the cheat sheet's main content occupied a
> vertical strip with fairly wide margins left and right. Unless you're
> putting the full text of the Declaration of Independence into one of
> the tooltips I don't see there being much likelihood of a problem
> there.
>
> Furthermore, eschewing standard tooltips and using JS or something to
> roll your own would likely render the tooltips inaccessible (or worse,
> confusing) with screen-reader software for the visually impaired.
>
> --
> 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: newbie struggling with Clooj and jars

2012-03-23 Thread Arthur Edelstein
Hi vet,

In clooj + lein, there are three steps to adding a jar to a project.
1. Edit the project.clj file to include the artifact in the project's 
dependencies
2. Go to the command line and type "lein deps"
3. Go back to clooj and choose the menu item REPL > Restart

Restarting the REPL loads all jars inside the project's lib directory on 
the classpath. You shouldn't have to restart clooj itself.

Arthur


On Wednesday, March 21, 2012 12:42:36 PM UTC-7, TI Explorer vet wrote:
>
> I love the premise of Clojure and the simplicity of Clooj.  I used to 
> write Lisp in Emacs years ago but I'd rather not dust off the Emacs brain 
> cells.
>
> I'm trying to write a simple Twitter client in Clojure. I've got 
> twitter-api  downloaded and 
> installed and can run the example with 'lein repl', but I can't get it to 
> work with Clooj.  I compiled twitter-api into a jar and stuck it into a 
> "jars" subfolder.  Then I tried this in the Clooj REPL:
>
> (ns mynamespace
>
>   (:use
>
>[twitter.oauth]
>
>[twitter.callbacks]
>
>[twitter.callbacks.handlers]
>
>[twitter.api.restful])
>
>   (:import
>
>(twitter.callbacks.protocols SyncSingleCallback)))
>
>
> and got the following error message:
>
>
> #> oauth/client__init.class or oauth/client.clj on classpath: >
>
>
> I'm confused, because Clooj seems to think the jar is in its classpath:
>
>
>  Classpath:
>
>   /Users/david/Documents/​coaching/TPG/TwitterBot/jars
>
>   /Users/david/Documents/​coaching/TPG/TwitterBot/src
>
>   /Users/david/Documents/​coaching/TPG/TwitterBot/​twitter-api
>
>   /Users/david/Documents/​coaching/TPG/TwitterBot/jars/​twitter-api-0.6.4.jar
>
>  
> I can write code in Clooj, save it to disk, and use 'lein run', but I'd 
> rather be able to compile a function at a time like I used to in Lisp/Emacs 
> and I'm assuming this is possible in Clooj.
>
> What I am missing?
>
>
On Wednesday, March 21, 2012 12:42:36 PM UTC-7, TI Explorer vet wrote:
>
> I love the premise of Clojure and the simplicity of Clooj.  I used to 
> write Lisp in Emacs years ago but I'd rather not dust off the Emacs brain 
> cells.
>
> I'm trying to write a simple Twitter client in Clojure. I've got 
> twitter-api  downloaded and 
> installed and can run the example with 'lein repl', but I can't get it to 
> work with Clooj.  I compiled twitter-api into a jar and stuck it into a 
> "jars" subfolder.  Then I tried this in the Clooj REPL:
>
> (ns mynamespace
>
>   (:use
>
>[twitter.oauth]
>
>[twitter.callbacks]
>
>[twitter.callbacks.handlers]
>
>[twitter.api.restful])
>
>   (:import
>
>(twitter.callbacks.protocols SyncSingleCallback)))
>
>
> and got the following error message:
>
>
> #> oauth/client__init.class or oauth/client.clj on classpath: >
>
>
> I'm confused, because Clooj seems to think the jar is in its classpath:
>
>
>  Classpath:
>
>   /Users/david/Documents/​coaching/TPG/TwitterBot/jars
>
>   /Users/david/Documents/​coaching/TPG/TwitterBot/src
>
>   /Users/david/Documents/​coaching/TPG/TwitterBot/​twitter-api
>
>   /Users/david/Documents/​coaching/TPG/TwitterBot/jars/​twitter-api-0.6.4.jar
>
>  
> I can write code in Clooj, save it to disk, and use 'lein run', but I'd 
> rather be able to compile a function at a time like I used to in Lisp/Emacs 
> and I'm assuming this is possible in Clooj.
>
> What I am missing?
>
>
On Wednesday, March 21, 2012 12:42:36 PM UTC-7, TI Explorer vet wrote:
>
> I love the premise of Clojure and the simplicity of Clooj.  I used to 
> write Lisp in Emacs years ago but I'd rather not dust off the Emacs brain 
> cells.
>
> I'm trying to write a simple Twitter client in Clojure. I've got 
> twitter-api  downloaded and 
> installed and can run the example with 'lein repl', but I can't get it to 
> work with Clooj.  I compiled twitter-api into a jar and stuck it into a 
> "jars" subfolder.  Then I tried this in the Clooj REPL:
>
> (ns mynamespace
>
>   (:use
>
>[twitter.oauth]
>
>[twitter.callbacks]
>
>[twitter.callbacks.handlers]
>
>[twitter.api.restful])
>
>   (:import
>
>(twitter.callbacks.protocols SyncSingleCallback)))
>
>
> and got the following error message:
>
>
> #> oauth/client__init.class or oauth/client.clj on classpath: >
>
>
> I'm confused, because Clooj seems to think the jar is in its classpath:
>
>
>  Classpath:
>
>   /Users/david/Documents/​coaching/TPG/TwitterBot/jars
>
>   /Users/david/Documents/​coaching/TPG/TwitterBot/src
>
>   /Users/david/Documents/​coaching/TPG/TwitterBot/​twitter-api
>
>   /Users/david/Documents/​coaching/TPG/TwitterBot/jars/​twitter-api-0.6.4.jar
>
>  
> I can write code in Clooj, save it to disk, and use 'lein run', but I'd 
> rather be able to compile a function at a time like I used to in Lisp/Emacs 
> and I'm assuming this is possible in Clooj.
>
> What I am missing?
>
>

-- 
You received this message because you a

Re: Use metadata instead of :require-macros for requiring macros from ClojureScript?

2012-03-23 Thread Evan Mezeske
On Friday, March 23, 2012 5:26:16 AM UTC-7, David Nolen wrote:
>
> This needs a design page on Confluence. Anything under discussion should 
> probably address the new :refer.
>
> David
>

I'd be happy to consolidate this topic into a wiki page if I had the 
privileges needed to create one.  Or maybe if someone created the page, 
there might be some way to grant me access to edit just that one page?

Also, is this 
threadthe
 "new :refer" to which you refer?

-Evan 

-- 
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: Use metadata instead of :require-macros for requiring macros from ClojureScript?

2012-03-23 Thread David Nolen
That's the thread. Please send in your CA and you can get access to
Confluence & JIRA :)

David

On Fri, Mar 23, 2012 at 5:45 PM, Evan Mezeske  wrote:

> On Friday, March 23, 2012 5:26:16 AM UTC-7, David Nolen wrote:
>>
>> This needs a design page on Confluence. Anything under discussion should
>> probably address the new :refer.
>>
>> David
>>
>
> I'd be happy to consolidate this topic into a wiki page if I had the
> privileges needed to create one.  Or maybe if someone created the page,
> there might be some way to grant me access to edit just that one page?
>
> Also, is this 
> threadthe
>  "new :refer" to which you refer?
>
> -Evan
>
> --
> 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: newbie struggling with Clooj and jars

2012-03-23 Thread Phil Hagelberg
Arthur Edelstein  writes:

> In clooj + lein, there are three steps to adding a jar to a project.
> 1. Edit the project.clj file to include the artifact in the project's
> dependencies
> 2. Go to the command line and type "lein deps"
> 3. Go back to clooj and choose the menu item REPL > Restart

Have you gotten a chance to look at the leiningen-core library? It
should let you handle this kind of thing in-process, possibly without
even having Leiningen installed. It's designed with that kind of thing
in mind, so I'd be very interested in hearing how that works out in
practice.

-Phil

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


Re: revisiting community funding?

2012-03-23 Thread nchurch
I like BernardH's idea of doing it anonymously; if nobody from Core
minds, we could set up an anonymous survey to see how much interest
there is.

cej38, your suggestions are very soundpersonally, I would love to
see curated, distilled APIs for common things a Clojure programmer
needs to do from Java or JavaScript, not just I/O.

However, it's ultimately a matter of what developers want to do, and
what core people think should be done.  So long as work leads to
improvement of the Clojure language and ecosystemwhich happens
continually anywayI don't think one should care where funds go.
In the long term, offering bounties for specific things might be a way
to spur fast progress of needed things, but I feel that should only be
tried after basic community funding works.

It seems like open source software development settles into a groove
that isn't Pareto efficient, even if it's much better than closed
source.  Think about how much time we all invest in learning and
developing Clojure.  The more the ecosystem expands, the more our
investments of learning and development come to be worth, and the less
likely we are to lose them to some other technology taking over down
the road.  And yet the ecosystem itself only gets worked on as a
second priority to other work.

It's a dilemma: either you get unsharable, secret technology worked on
full-time, or you get sharable technology part-time (with maintenance
dependent on the vicissitudes of life).  I'd like to think a generous
and not overly expectatious community can transcend it.


On Mar 23, 7:12 am, cej38  wrote:
> I am willing to contribute, and have in the past, but I think that
> instead of just contributing some cash and hoping things that we want
> will be worked on, I would propose that we structure it some.  In
> fact, I come up with a few projects that could be of use to the whole
> community, or at least a large subset of the community.  The clojure/
> core team could determine how much time that they think it will take
> to finish a project (or at least make real progress), and then have a
> fundraising goal for that project.  It would be kinda like we are
> hiring them to work on the projects that we want to see finished.
>
> A few ideas of topics:
> clojure-in-clojure
> a standard IO API that different VM implementations support
> Liebke's map/reduce
> fleshing out clojure.contrib libraries to bring them back to par with
> contrib 1.2 (a standard API page like what was had through
> clojure.contrib 1.2 would be REALLY awsome)
> faster numerics

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


why do we need a (require…)?

2012-03-23 Thread Frank Siebenlist
I can see the need for refer and alias, but why can the compiler not infer from 
the use of a fully qualified name that a namespace (or class) that is not 
loaded yet, has to be "required"?

Or did I miss anything?

-FrankS.



-- 
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: GSoC: Browser-based Clojure(Script) editor

2012-03-23 Thread Zack Maril
I think you would probably have the most meaningful success if you focused 
on making things that let people teach themselves Clojurescript. Making the 
editor intuitive for beginners would be a major win. Allowing them to 
visualize data structures and algorithms that they have written in 
Clojurescript would be excellent. Look into maybe incorporating 
http://keminglabs.com/c2/ or just start up d3. 

The ideal for beginners you would be working towards: 
http://reference.wolfram.com/mathematica/guide/Mathematica.html 

This is the best documentation I have ever seen. I taught myself not just 
Mathematica but vast swaths of math and statistics with this.* If you can 
make a set of examples that people can open up in their editor and evaluate 
and change right there in the browser, Clojurescript would win the 
internet. In fact, if you don't apply to GSoC with this idea, I will. 
-Zack

*Full disclosure: I've been employed by Wolfram previously. Total fan boy 
here. 

On Thursday, March 22, 2012 8:23:53 AM UTC-2, Martin Forsgren wrote:
>
> Hello! 
> I am thinking of applying to GSoC and I found the proposal to continue 
> working on Chris Grangers Clojure(script)-editor in "Bret Victor- 
> style" really interesting. 
>
> I have some ideas on features that I think would be nice to have, 
> other than opening, saving and compiling files: 
>
> Visualization of functions à la Bret Victor (Let the user give example 
> input, then print the values of all local vars (and maybe return 
> values of function calls) at the side of the function). Using 
> clojure.tools.trace or CDT perhaps? 
> Possibility to add the example input and the corresponding expected 
> output as an unit test for the function. 
>
> Pluggable ui-widgets (like the slider and colorpicker in Brets talk). 
> Examples: slider, checkbox, colorpicker, filechooser, datepicker, 
> mouse movement recorder, piano?, whatever. 
> (predicate dispatch to determine what widget to choose? :) 
>
> Pluggable widgets for visualising data(structures) could also be 
> created.(Perhaps inline widgets? Although I think that most often 
> would be more annoying than helpful.) 
>
> Use kibit to highlight code that could be rewritten. 
>
> Visualising the call-stack (as Chris suggested) 
>
> Graphs of relations between namespaces. 
>
> What do you think? Do you have other ideas? What features do you think 
> one should focus on first ? Please give some feedback. 
>

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

Re: New(er) Clojure cheatsheet hot off the presses

2012-03-23 Thread Cedric Greevey
On Fri, Mar 23, 2012 at 4:49 PM, Andy Fingerhut
 wrote:
> I'm not putting the Declaration of Independence in the tooltips, but the
> Clojure doc strings, with the same text width as they appear in the original,
> which is nearly 80 characters wide.

I'd suggest not using the full docstring, but something like the first
sentence or so of the docstring, or even a briefer paraphrase.

For example, for disj, map, and for, respectively, I'd suggest something like:

Returns a copy of a set that does not contain specified keys.

Iterates over a coll, or several colls in tandem, collecting the
results of applying a fn.

General sequence comprehensions (macro).

The main purpose is to let someone quickly gauge whether the link
they're hovering over is for the thing they're looking for. So it
suffices for the description to either jog their memory, if they've
seen it before, and give a quick precis of what it does or is used for
regardless. The tooltip text doesn't need to be the full
documentation; just enough information to guide a decision whether to
click through to the full documentation or not.

-- 
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: revisiting community funding?

2012-03-23 Thread Cedric Greevey
On Fri, Mar 23, 2012 at 7:35 PM, nchurch  wrote:
> I like BernardH's idea of doing it anonymously; if nobody from Core
> minds, we could set up an anonymous survey to see how much interest
> there is.
>
> cej38, your suggestions are very soundpersonally, I would love to
> see curated, distilled APIs for common things a Clojure programmer
> needs to do from Java or JavaScript, not just I/O.

I'd suggest the I/O library for ClojureJVM be a moderately-thick
wrapper around java.io, java.nio, and java.net, incorporating the
existing clojure.java.io things and with-open of course. Then
implement it on ClojureCLR and ClojureScript (and any others?) to
present the same API to users, while doing whatever is necessary under
the hood.

This *should* work reasonably well, since java.io is already, out of
necessity, a common-denominator cross-platform I/O abstraction.

> In the long term, offering bounties for specific things might be a way
> to spur fast progress of needed things, but I feel that should only be
> tried after basic community funding works.

An alternative would be to go outside clojure.core and set up a kind
of "Kickstarter for programmers" where people can propose and pledge
money to various software developments in general, and those who code
and release (with an open license) something that fits the bill get to
collect the bounty. (There'd be some interesting dynamics. For
instance, someone who can code feature X for Clojure, Debian, or
whatever might be tempted to code it but hold off on releasing it
until the bounty accumulates more pledges, but that risks being
scooped by someone else who started coding later but isn't as greedy.
Also, pledges would presumably be expiring, the money returned to the
donor from escrow N weeks after being pledged if the program/feature
isn't released by then.) Established FOSS development teams like
clojure.core could also claim the pot for something they did
themselves. Of course, for the requirements for a new feature for an
existing FOSS program to be met would require that its devteam accept
the patch and release a new version (a public beta, at minimum) with
the patch, in most cases; I suppose those who proposed the bounty can
decide in advance whether to accept a fork or only a new official
version in that case. They need to set criteria for what qualifies as
fulfulling the bounty regardless, so that would just be one more
criterion.

> It seems like open source software development settles into a groove
> that isn't Pareto efficient, even if it's much better than closed
> source.  Think about how much time we all invest in learning and
> developing Clojure.  The more the ecosystem expands, the more our
> investments of learning and development come to be worth, and the less
> likely we are to lose them to some other technology taking over down
> the road.  And yet the ecosystem itself only gets worked on as a
> second priority to other work.

That's probably as it should be. The ecosystem itself is, after all, a
means to an ends (useful software tools) rather than an end in itself.
Things that directly improve the ends (the tools coded in Clojure)
will naturally get some priority over things that do so indirectly
(ecosystem improvements).

That said, one of the less efficient things about the Clojure
development process is the whole CA thing. A lot of FOSS projects seem
to get by fine without erecting such a barrier to participation. On
top of that, I'm not sure the CA thing really protects Clojure from
the boogeyman of someone later deciding to rescind their permission to
use code they wrote. After 35 years, someone who signed their CA and
sent it in can claim termination rights and effectively undo the CA,
and if you don't think their code will still be in use in 35 years,
sorry, but that isn't where a betting man should be putting his chips.
The guys that wrote all those two-digit date fields in all that old
COBOL code for various banking systems back in the early 60s clearly
didn't expect that code to still be in use on January 1, 2000, and
look what happened. :)

> It's a dilemma: either you get unsharable, secret technology worked on
> full-time, or you get sharable technology part-time (with maintenance
> dependent on the vicissitudes of life).  I'd like to think a generous
> and not overly expectatious community can transcend it.

Lots already have, notably the Linux community.

OT side issue, added because this is the main group of outside-opinion
techies I have access to: a Vista box we use for miscellaneous
purposes got hit by the "System Fix" scareware recently. Diagnosis was
easy and recovery was complete and only took tdsskiller, another
malware scrubber, four reboots, and a couple of hours (aided by having
physically shut off the power and restarted in Safe Mode as soon as it
was clear that the box had somehow been hacked), but I'd very much
like to know how that box got hacked in the first place. Nobody that
has access to it isn't tech-sav

Alternate set literal syntax?

2012-03-23 Thread Cedric Greevey
#{foo bar baz} is somewhat ugly. It occurs to me that one could modify
the reader to additionally accept

{{foo bar baz}}

without breaking anything. It's not possible for it to be a valid map
literal, because the outer {...} pair has only one object inside it
and a map literal requires an even number of objects (zero, two, four
...), so right now {{foo bar baz}} will just throw a
CompilerException, and so will {{foo bar baz quux}} even though the
inner {...} pair then has an even number of objects. Making the reader
treat that as a set literal is therefore a purely additive change.

It's one character longer than #{foo bar baz} but it looks nicer, IMO,
and still shows the cousin-ship between sets and maps by using the
same choice among {}, [], ().

-- 
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: Alternate set literal syntax?

2012-03-23 Thread Ambrose Bonnaire-Sergeant
I'm a fan of #{foo bar baz}.

Ambrose

On Sat, Mar 24, 2012 at 11:44 AM, Cedric Greevey  wrote:

> #{foo bar baz} is somewhat ugly. It occurs to me that one could modify
> the reader to additionally accept
>
> {{foo bar baz}}
>
> without breaking anything. It's not possible for it to be a valid map
> literal, because the outer {...} pair has only one object inside it
> and a map literal requires an even number of objects (zero, two, four
> ...), so right now {{foo bar baz}} will just throw a
> CompilerException, and so will {{foo bar baz quux}} even though the
> inner {...} pair then has an even number of objects. Making the reader
> treat that as a set literal is therefore a purely additive change.
>
> It's one character longer than #{foo bar baz} but it looks nicer, IMO,
> and still shows the cousin-ship between sets and maps by using the
> same choice among {}, [], ().
>
> --
> 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: Alternate set literal syntax?

2012-03-23 Thread Alex Baranosky
Even if #{...} was ugly (which I don't feel one way or the other on),
having two special syntaxes for the same thing is even uglier than having
one ugly set literal notation :)

On Sat, Mar 24, 2012 at 12:19 AM, Ambrose Bonnaire-Sergeant <
abonnaireserge...@gmail.com> wrote:

> I'm a fan of #{foo bar baz}.
>
> Ambrose
>
>
> On Sat, Mar 24, 2012 at 11:44 AM, Cedric Greevey wrote:
>
>> #{foo bar baz} is somewhat ugly. It occurs to me that one could modify
>> the reader to additionally accept
>>
>> {{foo bar baz}}
>>
>> without breaking anything. It's not possible for it to be a valid map
>> literal, because the outer {...} pair has only one object inside it
>> and a map literal requires an even number of objects (zero, two, four
>> ...), so right now {{foo bar baz}} will just throw a
>> CompilerException, and so will {{foo bar baz quux}} even though the
>> inner {...} pair then has an even number of objects. Making the reader
>> treat that as a set literal is therefore a purely additive change.
>>
>> It's one character longer than #{foo bar baz} but it looks nicer, IMO,
>> and still shows the cousin-ship between sets and maps by using the
>> same choice among {}, [], ().
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clojure@googlegroups.com
>> Note that posts from new members are moderated - please be patient with
>> your first post.
>> To unsubscribe from this group, send email to
>> clojure+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>
>
>  --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
>

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

Re: revisiting community funding?

2012-03-23 Thread Sean Corfield
On Fri, Mar 23, 2012 at 8:09 PM, Cedric Greevey  wrote:
> That said, one of the less efficient things about the Clojure
> development process is the whole CA thing. A lot of FOSS projects seem
> to get by fine without erecting such a barrier to participation.

I can't think of a single large open source project that doesn't
require a contributor agreement in place.

Various Linux flavors:
https://fossbazaar.org/content/open-source-contributor-agreements-some-examples

Scala: http://www.scala-lang.org/sites/default/files/contributor_agreement.pdf

Python: http://python.org/psf/contrib/contrib-form/

Django: https://www.djangoproject.com/foundation/cla/

Node.js: http://nodejs.org/cla.html

Java: http://www.oracle.com/technetwork/community/oca-486395.html

Apache projects: http://www.apache.org/licenses/icla.txt

In my search for links, I found that Groovy apparently does not
require a written CA. Given all the above, this surprised me.
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

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

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


Re: Alternate set literal syntax?

2012-03-23 Thread Sean Corfield
On Fri, Mar 23, 2012 at 8:44 PM, Cedric Greevey  wrote:
> #{foo bar baz} is somewhat ugly. It occurs to me that one could modify
> the reader to additionally accept
>
> {{foo bar baz}}

My concern is that {{1 2 3 4}5} is currently legal - a map with a map
as a key and 5 as the value. That means that the reader couldn't tell
if {{ introduced your set notation or the start of a nested map
without looking arbitrarily far ahead. And that problem gets worse if
you encounter {{{ or  or... {{{ could introduce a nested map, a
map of your sets or one of your sets containing a map...
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

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

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