Re: mu4e:view show email address after display name in message headers

2018-09-25 Thread Colin Yates
Come one now, mocking _AND_ being helpful, that’s just not on! What sort of 
internet would this be if we all went around, (shudder) helping (urgh) each 
other ;-).

> This is definitely the wrong list, but given how easy it is to do this, I 
> thought I'd help you out.
> 
> (setq mu4e-view-show-addresses t)
> 
>> Going a step farther, it would be great to use a function with access to 
>> this information ...
> 
> Setting it to a function is harder, but you could advise 
> mu4e~view-construct-contacts-header if you really wanted to. That's not a 
> public function, though, so it might change in future.

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


Re: mu4e:view show email address after display name in message headers

2018-09-25 Thread Jeff Kowalczyk
Yes, sorry all for the noise. The message was addressed to the wrong list 
in Google Groups UI due to pilot error. Deleted the original post but it 
still goes out to mail interface users. Apologies again.

Jeff

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


Re: mu4e:view show email address after display name in message headers

2018-09-24 Thread Carlo Zancanaro

Hey Jeff,

On Tue, Sep 25 2018, Jeff Kowalczyk wrote:
I would like to configure mu4e:view to display the email address 
along with the display name in the To: From: Cc: Bcc: etc 
fields.


This is definitely the wrong list, but given how easy it is to do 
this, I thought I'd help you out.


 (setq mu4e-view-show-addresses t)

Going a step farther, it would be great to use a function with 
access to this information ...


Setting it to a function is harder, but you could advise 
mu4e~view-construct-contacts-header if you really wanted to. 
That's not a public function, though, so it might change in 
future.


Carlo

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

To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: mu4e:view show email address after display name in message headers

2018-09-24 Thread Colin Yates
I guess you could do this in clojure, but you might want to try elisp first ;-).

(I expect the overlap of emacs, clojure and mu users to be significant, so 
maybe this wasn’t the wrong group after all!)

Sent from my iPhone

> On 24 Sep 2018, at 18:26, Jeff Kowalczyk  wrote:
> 
> I would like to configure mu4e:view to display the email address along with 
> the display name in the To: From: Cc: Bcc: etc fields. Is this possible with 
> current mu4e customization options? The information is already present in the 
> buffer: if I hover over the name with the mouse cursor, email addresses are 
> displayed in a tool tip. That's not ideal for hands on keyboard usage, 
> however. 
> 
> Going a step farther, it would be great to use a function with access to this 
> information to selectively show the email address or otherwise decorate the 
> display name. i.e. Having the display name read: "John Smith (ACME)", or 
> "Fred Factor (outside)" would be highly convenient.
> 
> Thanks,
> Jeff
> -- 
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with your 
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

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


mu4e:view show email address after display name in message headers

2018-09-24 Thread Jeff Kowalczyk
I would like to configure mu4e:view to display the email address along with 
the display name in the To: From: Cc: Bcc: etc fields. Is this possible 
with current mu4e customization options? The information is already present 
in the buffer: if I hover over the name with the mouse cursor, email 
addresses are displayed in a tool tip. That's not ideal for hands on 
keyboard usage, however. 

Going a step farther, it would be great to use a function with access to 
this information to selectively show the email address or otherwise 
decorate the display name. i.e. Having the display name read: "John Smith 
(ACME)", or "Fred Factor (outside)" would be highly convenient.

Thanks,
Jeff

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


Re: Show: Naive data fitting with Nyarlathotep

2015-08-14 Thread Robert Levy
That sounds interesting!  So far I get a 404.  Maybe the repo needs to be
set public?

On Fri, Aug 14, 2015 at 11:19 AM, Divyansh Prakash 
divyanshprakas...@gmail.com wrote:

 Hey!
 Nyarlathotep https://github.com/divs1210/nyarlathotep is a tiny
 mathematical function generator that can be used as a (very naive) data
 fitting tool.
 It generates random functions and tests them against provided constraints.
 I don't think it's of any practical use, but it is fascinating to watch it
 in action.

 - Divyansh

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


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


Show: Naive data fitting with Nyarlathotep

2015-08-14 Thread Divyansh Prakash
Hey!
Nyarlathotep https://github.com/divs1210/nyarlathotep is a tiny 
mathematical function generator that can be used as a (very naive) data 
fitting tool.
It generates random functions and tests them against provided constraints.
I don't think it's of any practical use, but it is fascinating to watch it 
in action.

- Divyansh

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


cider-repl show java and clojure version nil

2015-02-03 Thread SK Kim
Hello all,

This is what cider-repl shows right after cider-jack-in.

; CIDER 0.9.0alpha (package: 20150131.203) (Java nil, Clojure nil, nREPL 0.2
.3)
user 

It shows java and clojure version nil.

*clojure-version* value is as below:
user *clojure-version*
{:major 1, :minor 6, :incremental 0, :qualifier nil}


Looks like everything works fine but it is annoying to watch it everytime. 
If anybody knows the reason, pls help me.
Thanks.

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


Re: cider-repl show java and clojure version nil

2015-02-03 Thread Bozhidar Batsov
You're using a very old version of nREPL, which is likely coming from an
older version of lein. Try using the latest the latest leiningen.

On 3 February 2015 at 16:29, SK Kim tttuuu...@gmail.com wrote:

 Hello all,

 This is what cider-repl shows right after cider-jack-in.

 ; CIDER 0.9.0alpha (package: 20150131.203) (Java nil, Clojure nil, nREPL
 0.2.3)
 user

 It shows java and clojure version nil.

 *clojure-version* value is as below:
 user *clojure-version*
 {:major 1, :minor 6, :incremental 0, :qualifier nil}


 Looks like everything works fine but it is annoying to watch it everytime.
 If anybody knows the reason, pls help me.
 Thanks.

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


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


Re: cider-repl show java and clojure version nil

2015-02-03 Thread SK Kim
That was it. I have tried re-install everything but leiningen till now.
Thanks a lot~


2015년 2월 4일 수요일 오전 7시 11분 52초 UTC+9, Bozhidar Batsov 님의 말:

 You're using a very old version of nREPL, which is likely coming from an 
 older version of lein. Try using the latest the latest leiningen. 

 On 3 February 2015 at 16:29, SK Kim tttu...@gmail.com javascript: 
 wrote:

 Hello all,

 This is what cider-repl shows right after cider-jack-in.

 ; CIDER 0.9.0alpha (package: 20150131.203) (Java nil, Clojure nil, nREPL 
 0.2.3)
 user 

 It shows java and clojure version nil.

 *clojure-version* value is as below:
 user *clojure-version*
 {:major 1, :minor 6, :incremental 0, :qualifier nil}


 Looks like everything works fine but it is annoying to watch it 
 everytime. 
 If anybody knows the reason, pls help me.
 Thanks.

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




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


Re: clojure.main on a clj file does not show up any println

2014-12-09 Thread Gary Verhaegen
You need to set the http_proxy variable for lein to work behind a peoxy.
Maybe the https_proxy too.

If your proxy does man-in-the-middle style https interception, you might
also need to downgrade leiningen to 2.3.x, depending on how badly the proxy
server is configured.

The syntax of http_proxy is

http://user:password@host:port

So, on unix:

export http_proxy=http://user:passw...@example.com:8080
export https_proxy=$http_proxy

On Windows, you can set environment variables from the system properties
(advanced tab or something, iirc).

On Tuesday, 9 December 2014, Ganesh Krishnamoorthy ganesh@gmail.com
wrote:

 That helped, Thanks! The Clojure CLR seems to be working a bit different.
 It insists on a ns, creates an exe by ns and its readily run-able.
 I gave Lein a shot too, but apparently its looking for some dependencies
 to be downloaded, I am behind a proxy so that dint work too...
 Is there a dependencies distrib i can download and place it?

 On Monday, December 8, 2014 7:32:16 PM UTC+5:30, Ganesh Krishnamoorthy
 wrote:

 I have been trying all my bit on to get my hello world working; Any help
 is much appreciated...

 am trying to run it by
 java -cp clojure-1.6.0.jar clojure.main hey.clj
 I just get an empty line.
 Below is my file:

 (defn -main
   []
   (println Hello World!)
   (println (- 1 1)))

  --
 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
 javascript:_e(%7B%7D,'cvml','clojure@googlegroups.com');
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 javascript:_e(%7B%7D,'cvml','clojure%2bunsubscr...@googlegroups.com');
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com
 javascript:_e(%7B%7D,'cvml','clojure%2bunsubscr...@googlegroups.com');.
 For more options, visit https://groups.google.com/d/optout.


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


clojure.main on a clj file does not show up any println

2014-12-08 Thread Ganesh Krishnamoorthy
I have been trying all my bit on to get my hello world working; Any help is 
much appreciated...

am trying to run it by 
java -cp clojure-1.6.0.jar clojure.main hey.clj
I just get an empty line.
Below is my file:

(defn -main
  []
  (println Hello World!)
  (println (- 1 1)))

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


Re: clojure.main on a clj file does not show up any println

2014-12-08 Thread Stephen Gilardi

 On Dec 8, 2014, at 9:02 AM, Ganesh Krishnamoorthy ganesh@gmail.com 
 wrote:
 
 I have been trying all my bit on to get my hello world working; Any help is 
 much appreciated...
 
 am trying to run it by 
 java -cp clojure-1.6.0.jar clojure.main hey.clj
 I just get an empty line.
 Below is my file:
 
 (defn -main
   []
   (println Hello World!)
   (println (- 1 1)))

That calling syntax for clojure.main executes the contents of the hey.clj file. 
Your file defines a -main function, but no code will call it. If you add a call 
to your main function, it runs:

(-main)

There are other options for clojure.main.  There’s more info here: 
http://clojure.org/repl_and_main http://clojure.org/repl_and_main and here: 
http://www.beaconhill.com/blog/?p=283 http://www.beaconhill.com/blog/?p=283

—Steve

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


Re: clojure.main on a clj file does not show up any println

2014-12-08 Thread Ganesh Krishnamoorthy
That helped, Thanks! The Clojure CLR seems to be working a bit different. 
It insists on a ns, creates an exe by ns and its readily run-able.
I gave Lein a shot too, but apparently its looking for some dependencies to 
be downloaded, I am behind a proxy so that dint work too...
Is there a dependencies distrib i can download and place it?

On Monday, December 8, 2014 7:32:16 PM UTC+5:30, Ganesh Krishnamoorthy 
wrote:

 I have been trying all my bit on to get my hello world working; Any help 
 is much appreciated...

 am trying to run it by 
 java -cp clojure-1.6.0.jar clojure.main hey.clj
 I just get an empty line.
 Below is my file:

 (defn -main
   []
   (println Hello World!)
   (println (- 1 1)))



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


apps uploaded using lein-beanstalk don't show up in amazon beanstalk management console.

2013-10-22 Thread Romeo Van Snick
Hi,

I'm pretty new to clojure webdev as well as amazon aws but I'm trying to 
build
a small vanilla web app using lein-beanstalk to deploy the app without 
having 
to know the gritty details of aws-hosting.

I'm getting along with lein-beanstalk since I can succesfully upload and 
use the webapp
but I have one thing thats strikes me as quirky.

The webapp only shows up in the amazon S3 management console, and not in the
Elastic Beanstalk console.

So i can only find a bunch of war files in S3, wich I cannot manipulate or 
configurate
using the management console.

What's up with this? Could someone enlighten me as in how this works (where 
do these war files get executed for example, and do they enjoy 
load-balancing,
CDN etc.?)

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


Re: [ANN] Show the latest version of the library on your Github README page

2013-10-09 Thread Christopher Allen
Thank you for this!

What could be done to make the text highlightable/copyable?

On Tuesday, October 8, 2013 6:25:07 AM UTC-7, Alexander Yakushev wrote:

 Have you ever felt annoyed to update the README after you released a new 
 version of your project? Have your users ever struggled to make the older 
 version work because you forgot to update that README? Suffer no more, 
 because Clojars has just the right medicine for you.

 From now on, you can append */latest-version.svg* to your artefact's 
 link, which will resolve to an image that shows the latest version of your 
 project. Then you can embed this image in your README, or Wiki, or wherever 
 else you like. A couple examples:

 https://clojars.org/leiningen/latest-version.svg
 https://clojars.org/com.palletops/pallet-cli/latest-version.svg

 The only downside of using this feature is that the user can't just select 
 and copy the dependency line anymore. Although Webkit-based browsers 
 support text selection in SVGs (and Firefox's support for one is on the 
 way) it works only when opening the single image, but not when the image is 
 embedded into the page. But I hope it can be worked around somehow in 
 future.

 Thanks to Nelson Morris and Phil Hagelberg for pushing this out!


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


Re: [ANN] Show the latest version of the library on your Github README page

2013-10-09 Thread Alexander Yakushev
The inability to select the text in SVG comes from img tag limitations. 
The following two ways of embedding SVG image into the webpage allows 
selecting text in both Webkit browsers and Firefox (in the latter via 
double-clicking and then right-click-Copy):

object data=https://clojars.org/leiningen/latest-version.svg; 
type=image/svg+xml/object
embed src=https://clojars.org/leiningen/latest-version.svg; 
type=image/svg+xml /

Unfortunately, Github supports neither of them in its READMEs/wikis. So it 
can be used only when you have direct access to page's HTML, for instance 
on your own website or Github Pages.

Perhaps the inclusion of embed on Github might be lobbied someday, but 
I'm afraid not in the foreseeable future.

On Wednesday, October 9, 2013 11:47:37 PM UTC+2, Christopher Allen wrote:

 Thank you for this!

 What could be done to make the text highlightable/copyable?

 On Tuesday, October 8, 2013 6:25:07 AM UTC-7, Alexander Yakushev wrote:

 Have you ever felt annoyed to update the README after you released a new 
 version of your project? Have your users ever struggled to make the older 
 version work because you forgot to update that README? Suffer no more, 
 because Clojars has just the right medicine for you.

 From now on, you can append */latest-version.svg* to your artefact's 
 link, which will resolve to an image that shows the latest version of your 
 project. Then you can embed this image in your README, or Wiki, or wherever 
 else you like. A couple examples:

 https://clojars.org/leiningen/latest-version.svg
 https://clojars.org/com.palletops/pallet-cli/latest-version.svg

 The only downside of using this feature is that the user can't just 
 select and copy the dependency line anymore. Although Webkit-based browsers 
 support text selection in SVGs (and Firefox's support for one is on the 
 way) it works only when opening the single image, but not when the image is 
 embedded into the page. But I hope it can be worked around somehow in 
 future.

 Thanks to Nelson Morris and Phil Hagelberg for pushing this out!



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


[ANN] Show the latest version of the library on your Github README page

2013-10-08 Thread Alexander Yakushev
Have you ever felt annoyed to update the README after you released a new 
version of your project? Have your users ever struggled to make the older 
version work because you forgot to update that README? Suffer no more, 
because Clojars has just the right medicine for you.

From now on, you can append */latest-version.svg* to your artefact's link, 
which will resolve to an image that shows the latest version of your 
project. Then you can embed this image in your README, or Wiki, or wherever 
else you like. A couple examples:

https://clojars.org/leiningen/latest-version.svg
https://clojars.org/com.palletops/pallet-cli/latest-version.svg

The only downside of using this feature is that the user can't just select 
and copy the dependency line anymore. Although Webkit-based browsers 
support text selection in SVGs (and Firefox's support for one is on the 
way) it works only when opening the single image, but not when the image is 
embedded into the page. But I hope it can be worked around somehow in 
future.

Thanks to Nelson Morris and Phil Hagelberg for pushing this out!

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


Re: why does ps aux show a dump of my whole app?

2013-09-28 Thread Softaddicts
Simply because you get the full command line that started each of
these processes...

mongod is the mongo db server to which you connect, the other process
is most probably your Clojure project that happens to refer to mongo libs
in its classpatch which happens to appear on the command line.

Luc

 
 I admit I was surprised by this. 
 
 On my Mac, right now, MySql is running but nothing is connecting to it. So 
 if I do this:
 
 ps aux | grep mysql 
 
 I simply get:
 
  grep mysql
  /usr/local/Cellar/mysql/5.6.10/bin/mysqld 
 --basedir=/usr/local/Cellar/mysql/5.6.10 --datadir=/usr/local/var/mysql 
 --plugin-dir=/usr/local/Cellar/mysql/5.6.10/lib/plugin 
 --log-error=/usr/local/var/mysql/Larrys-MacBook-Pro.local.err 
 --pid-file=/usr/local/var/mysql/Larrys-MacBook-Pro.local.pid
 
 Which is what I was expecting. 
 
 But my Clojure app is attempting to connect to MongoDB, and I wasn't sure 
 if MongoDB is running. So I did this:
 
 ps aux | grep mongo
 
 I was very surprised that the output was so large: 
 
 ps aux | grep mongo
 
 larry 241   0.9  0.1  2721108   6276   ??  S 8Sep13 159:19.67 
 /usr/local/opt/mongodb/mongod run --config /usr/local/etc/mongod.conf
 
 larry 650   0.1  0.1  4748540   2564 s005  R+8Sep13  17:38.82 
 /usr/bin/java -classpath 
 /Users/larry/projects/walnut_admin/test:/Users/larry/projects/walnut_admin/dev:/Users/larry/projects/walnut_admin/src:/Users/larry/projects/walnut_admin/dev-resources:/Users/larry/projects/walnut_admin/resources:/Users/larry/projects/walnut_admin/target/classes:/Users/larry/.m2/repository/ring/ring-core/1.2.0-beta1/ring-core-1.2.0-beta1.jar:/Users/larry/.m2/repository/com/google/code/findbugs/jsr305/1.3.9/jsr305-1.3.9.jar:/Users/larry/.m2/repository/org/clojure/java.classpath/0.2.0/java.classpath-0.2.0.jar:/Users/larry/.m2/repository/com/google/inject/guice/2.0/guice-2.0.jar:/Users/larry/.m2/repository/org/clojure/core.cache/0.6.2/core.cache-0.6.2.jar:/Users/larry/.m2/repository/ring/ring-servlet/1.1.5/ring-servlet-1.1.5.jar:/Users/larry/.m2/repository/args4j/args4j/2.0.16/args4j-2.0.16.jar:/Users/larry/.m2/repository/com/novemberain/monger/1.4.2/monger-1.4.2.jar:/Users/larry/.m2/repository/clj-stacktrace/clj-stacktrace/0.2.5/clj-stacktrace-0.2.5.jar:/Users/larry/.m2/reposi
 tory/org
 
/mindrot/jbcrypt/0.3m/jbcrypt-0.3m.jar:/Users/larry/.m2/repository/javax/servlet/servlet-api/2.5/servlet-api-2.5.jar:/Users/larry/.m2/repository/com/cemerick/friend/0.1.5/friend-0.1.5.jar:/Users/larry/.m2/repository/ns-tracker/ns-tracker/0.1.2/ns-tracker-0.1.2.jar:/Users/larry/.m2/repository/org/apache/ant/ant-launcher/1.8.2/ant-launcher-1.8.2.jar:/Users/larry/.m2/repository/org/eclipse/jetty/orbit/javax.servlet/2.5.0.v201103041518/javax.servlet-2.5.0.v201103041518.jar:/Users/larry/.m2/repository/formative/formative/0.7.0/formative-0.7.0.jar:/Users/larry/.m2/repository/org/apache/commons/commons-compress/1.3/commons-compress-1.3.jar:/Users/larry/.m2/repository/net/jcip/jcip-annotations/1.0/jcip-annotations-1.0.jar:/Users/larry/.m2/repository/com/taoensso/timbre/1.2.0/timbre-1.2.0.jar:/Users/larry/.m2/repository/org/clojure/data.json/0.2.0/data.json-0.2.0.jar:/Users/larry/.m2/repository/ring/ring/1.1.5/ring-1.1.5.jar:/Users/larry/.m2/repository/ring/ring-codec/1.0.0/ring-code
 c-1.0.0.
 
jar:/Users/larry/.m2/repository/clout/clout/1.0.1/clout-1.0.1.jar:/Users/larry/.m2/repository/jkkramer/verily/0.5.4/verily-0.5.4.jar:/Users/larry/.m2/repository/xml-apis/xml-apis/1.3.03/xml-apis-1.3.03.jar:/Users/larry/.m2/repository/org/apache/httpcomponents/httpclient/4.2.1/httpclient-4.2.1.jar:/Users/larry/.m2/repository/org/clojure/core.incubator/0.1.1/core.incubator-0.1.1.jar:/Users/larry/.m2/repository/org/openid4java/openid4java-nodeps/0.9.6/openid4java-nodeps-0.9.6.jar:/Users/larry/.m2/repository/com/google/protobuf/protobuf-java/2.4.1/protobuf-java-2.4.1.jar:/Users/larry/.m2/repository/prismatic/dommy/0.1.1/dommy-0.1.1.jar:/Users/larry/.m2/repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar:/Users/larry/.m2/repository/org/apache/httpcomponents/httpcore/4.2.1/httpcore-4.2.1.jar:/Users/larry/.m2/repository/com/fasterxml/jackson/dataformat/jackson-dataformat-smile/2.1.4/jackson-dataformat-smile-2.1.4.jar:/Users/larry/.m2/repository/enlive/enlive/
 1.0.1/en
 

Re: How to (easily) show the advantages of Clojure

2013-01-20 Thread Bruce Durling
Perhaps a bit too specialised, but there is a good example for
hadoopers here:
https://groups.google.com/forum/?fromgroups=#!topic/cascading-user/i3b4KZsusVg

Paco Nathan rewrote the CoPA examples from his cascading work in Cascalog.

cheers,
Bruce

--
@otfrom | CTO  co-founder @MastodonC | mastodonc.com
See recent coverage of us in the Economist http://econ.st/WeTd2i and
the Financial Times http://on.ft.com/T154BA

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


Re: How to (easily) show the advantages of Clojure

2013-01-19 Thread Denis Labaye
On Wed, Jan 16, 2013 at 4:08 PM, Thomas th.vanderv...@gmail.com wrote:

 Hi All,

 Something that came up last night in the blank? thread. What is a good way
 to show someone the advantages of Clojure. Something that is simple, not
 too complicated, easily understood, shows a (significant) benefit, etc.

 Any ideas? (As said in the other thread, I have used the blank? example
 from Stuart Halloway to show people the difference).


Open a connection to a service/database/... and mess around with it (for
example a remote db, with a very slow connection initialization).
And show how it's easy to experiment when you always have the JVM up and
running.
Constrast it with Java for example, where when the unit test or the main
method is exited, you have to rebuild the context again.




 Thomas

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

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

Re: How to (easily) show the advantages of Clojure

2013-01-19 Thread Tim Cross
I think it depends a lot on your audience. For example, java spring 
programmers are likely going to be impressed by the simplicity and speed at 
which you can get a project started, especially when using lein and being 
able to avoid the common load of bolerplate java, xml, etc. Programmers 
familiar with database development etc, may appreciate the STM more, lisp 
programmers will likely be impressed by how easy it is to take advantage of 
the huge wealth of existing Java APIs and managers may be impressed by the 
fact things can be deployed under the existing ecosystem. 

There is no single answer, but a little research into what type of audience 
you are addressing will help. Try and find out what some of the current 
'pain points' are with their current environment. This could be testing, it 
could be deployment, it could be the ability to make rapid changes, handle 
concurrency issues, prototyping, cumbersome code, build test cycles etc. If 
you know this, you can structure examples that will clearly show the 
relevance and likely generate some excitement etc.

Tim


On Thursday, January 17, 2013 2:08:41 AM UTC+11, Thomas wrote:

 Hi All,

 Something that came up last night in the blank? thread. What is a good way 
 to show someone the advantages of Clojure. Something that is simple, not 
 too complicated, easily understood, shows a (significant) benefit, etc.

 Any ideas? (As said in the other thread, I have used the blank? example 
 from Stuart Halloway to show people the difference).

 Thomas


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

Re: How to (easily) show the advantages of Clojure

2013-01-17 Thread Mikera
On Wednesday, 16 January 2013 23:08:41 UTC+8, Thomas wrote:

 Hi All,

 Something that came up last night in the blank? thread. What is a good way 
 to show someone the advantages of Clojure. Something that is simple, not 
 too complicated, easily understood, shows a (significant) benefit, etc. 


Most important is to keep it really simple if the person hasn't used a Lisp 
/ Clojure before. Getting your head around the prefix syntax is hard 
enough, without introducing advanced stuff like Java interop. I think the 
blank? example is actually quite complex as a first example.

I'd just do it with examples at a REPL to show off different features, 
introducing them slowly, with a focus on functions and data. Examples:

(+ 1 2 3)

(inc 10)

[1 2 3]

(map inc [1 2 3])

(map (partial + 5) [1 2 3])

(range 10)

(filter odd? (range 10))

etc...

If after 15 minutes of examples like these you've demonstrated that Clojure 
is a beautiful, simple functional language and that the Lisp syntax is 
actually pretty handy, then I think you've done your job.


 

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

Re: How to (easily) show the advantages of Clojure

2013-01-17 Thread Lee Spector

On Jan 17, 2013, at 7:30 PM, Mikera wrote:
 
 I'd just do it with examples at a REPL to show off different features, 
 introducing them slowly, with a focus on functions and data. Examples:

FWIW I introduce Clojure to students (many of whom have no experience with Lisp 
and/or Java) with the long, saved REPL session here: 
https://github.com/lspector/clojinc

It starts with the kind of stuff Mikera started with but then goes on to more 
complex stuff, with the choices biased by my Lisp/AI-oriented background... 
which may not suit your tastes or needs but maybe you'll find some of it useful.

 -Lee

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


How to (easily) show the advantages of Clojure

2013-01-16 Thread Thomas
Hi All,

Something that came up last night in the blank? thread. What is a good way 
to show someone the advantages of Clojure. Something that is simple, not 
too complicated, easily understood, shows a (significant) benefit, etc.

Any ideas? (As said in the other thread, I have used the blank? example 
from Stuart Halloway to show people the difference).

Thomas

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

Re: How to (easily) show the advantages of Clojure

2013-01-16 Thread Meikel Brandmeyer (kotarak)
Hi,

I based a recent presentation in a local user group on the bank account 
example: two accounts, deposit, withdrawal, transfer. Starting with maps. 
Building the code. Noticing that no locks are required. Replacing maps with 
records w/o changes to underlying code. Easily testing pure functions. c. 
c. There was a lot of positive feedback. (Although I don't know how far 
things will get.) It was a two hours live session with many questions from 
the auditorium and ad hoc examples.

The advantage of the bank account kata is that chances are that people know 
this already in other (maybe OO) languages. So they can easily compare with 
their experiences. (In fact the same kata was discussed for OO languages in 
December in our user group.)

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: How to (easily) show the advantages of Clojure

2013-01-16 Thread Marko Topolnik
How about something from the world of concurrency? It is not as easy to 
demonstrate, though. Many true advantages are too subtle for elevatorspeak, 
though. For example, people used to pitch *pmap* that way: instantly turn a 
sequence transformation into a multicore-saturating performance king. The 
reality is that there are increased constant-time-and-space costs involved 
and there are major issues with chunked seqs.

Another similar thought is transforming an arbitrary calculation into a *
future*.

When I pitch Clojure, I use as much emotional arguments as rational ones, 
and I see many others feel the same way: the *joy of Clojure* is something 
many people feel. Sharing your enthusiasm works quite well in the field :)


On Wednesday, January 16, 2013 4:08:41 PM UTC+1, Thomas wrote:

 Hi All,

 Something that came up last night in the blank? thread. What is a good way 
 to show someone the advantages of Clojure. Something that is simple, not 
 too complicated, easily understood, shows a (significant) benefit, etc.

 Any ideas? (As said in the other thread, I have used the blank? example 
 from Stuart Halloway to show people the difference).

 Thomas


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

Re: How to (easily) show the advantages of Clojure

2013-01-16 Thread Feng Shen
How about Clojure's web

   1. Plain Clojure function as handler,  request and response are just 
   maps, they are printable.
   2. Easy testable: handler is a function, pass a request, get the 
   response, assert the response is wanted.
   3. Easy mockable: use bindings to mock centain functions. Like talking 
   to a database, read the content of a file.



On Wednesday, January 16, 2013 11:08:41 PM UTC+8, Thomas wrote:

 Hi All,

 Something that came up last night in the blank? thread. What is a good way 
 to show someone the advantages of Clojure. Something that is simple, not 
 too complicated, easily understood, shows a (significant) benefit, etc.

 Any ideas? (As said in the other thread, I have used the blank? example 
 from Stuart Halloway to show people the difference).

 Thomas


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

Re: How to (easily) show the advantages of Clojure

2013-01-16 Thread larry google groups
I have trouble finding a simple example, but I know I have written a
lot of apps that have less than 200 lines of code, but if I had
written them in PHP, they would have been a mess.

And consider this: I worked at WineSpectator.com for awhile, and they
had me writing big import scripts for the database. These projects
usually started off sounding small: Can you write a quick PHP script
to pull all the user subscriptions and update the user history table?
and then they ballooned in scope, with more tables being added, and
with more transformations of the data being added. A simple PHP script
is good for a simple import of database data, but once you get to
complicated transformations, which can be broken into pieces, then you
need a multi-threaded app. I wrote one PHP script which took data from
one table (that had 100 million rows) and had to combine it with data
from 3 other tables (one of which had 70 millions rows). The PHP
script took 3 days to run. At that point I made the argument to
management We can not handle this with PHP scripts, we need something
more sophisticated, and it needs to be multi-threaded. When they
heard multi-threaded they thought of Java, but they were afraid of
Java, because they felt it was verbose. Clojure is ideal for those
situations: concise, small, fast, multi-threaded.






On 16 Sty, 10:08, Thomas th.vanderv...@gmail.com wrote:
 Hi All,

 Something that came up last night in the blank? thread. What is a good way
 to show someone the advantages of Clojure. Something that is simple, not
 too complicated, easily understood, shows a (significant) benefit, etc.

 Any ideas? (As said in the other thread, I have used the blank? example
 from Stuart Halloway to show people the difference).

 Thomas

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


Re: How to (easily) show the advantages of Clojure

2013-01-16 Thread Gary Trakhman
Here's a quick example of getting all the streets in Baltimore from a 1GB 
XML file of Maryland map data.  I shudder to think of how to do this in 
java.  Takes about 60 seconds to run on my box.

https://gist.github.com/4548456


On Wednesday, January 16, 2013 10:08:41 AM UTC-5, Thomas wrote:

 Hi All,

 Something that came up last night in the blank? thread. What is a good way 
 to show someone the advantages of Clojure. Something that is simple, not 
 too complicated, easily understood, shows a (significant) benefit, etc.

 Any ideas? (As said in the other thread, I have used the blank? example 
 from Stuart Halloway to show people the difference).

 Thomas


-- 
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: No show?

2012-12-11 Thread Asim Jalis
This is a good workaround—however, I still wish repl-utils/show was still
there. It was nice to always have it there instead doing this defn every
time I need it to explore a Java API.

On Sat, Feb 11, 2012 at 6:30 PM, Michał Marczyk michal.marc...@gmail.comwrote:

 On 11 February 2012 10:35, Ken Restivo k...@restivo.org wrote:
  = (clojure.pprint/print-table (clojure.reflect/reflect Math))
  ClassCastException clojure.lang.Keyword cannot be cast to
 java.util.Map$Entry  clojure.lang.APersistentMap$KeySeq.first
 (APersistentMap.java:132)

 print-table expects a sequence of maps, e.g.

 (print-table (:members (reflect Math)))

 or

 (print-table (:members (reflect Math :ancestors true)))

 to include inherited members.

 Sincerely,
 Michał

 --
 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: pst shows the cause instead of the last thrown ex thus it doesn't show the chain

2012-10-25 Thread AtKaaZ
I can see why, here's the implementation of pst:
(defn pst
  Prints a stack trace of the exception, to the depth requested. If none
supplied, uses the root cause of the
  most recent repl exception (*e), and a depth of 12.
  {:added 1.3}
  ([] (pst 12))
  ([e-or-depth]
 (if (instance? Throwable e-or-depth)
   (pst e-or-depth 12)
   (when-let [e *e]
 (pst (root-cause e) e-or-depth
  ([^Throwable e depth]
 (binding [*out* *err*]
   (println (str (- e class .getSimpleName)  
 (.getMessage e)
 (when-let [info (ex-data e)] (str   (pr-str info)
   (let [st (.getStackTrace e)
 cause (.getCause e)]
 (doseq [el (take depth
  (remove #(#{clojure.lang.RestFn
clojure.lang.AFn} (.getClassName %))
  st))]
   (println (str \tab (stack-element-str el
 (when cause
   (println Caused by:)
   (pst cause (min depth
   (+ 2 (- (count (.getStackTrace cause))
   (count st))

so this works as expected:
= *(try (throw (Exception. a (Exception. cause))) (catch Exception e
(throw e)))
   (pst *e 123912031)*
Exception cause  cloj2.ka/eval1430 (NO_SOURCE_FILE:1)
Exception a
cloj2.ka/eval1430 (NO_SOURCE_FILE:1)
clojure.lang.Compiler.eval (Compiler.java:6603)
clojure.lang.Compiler.eval (Compiler.java:6566)
clojure.core/eval (core.clj:2836)
clojure.main/repl/read-eval-print--6667 (main.clj:245)
clojure.main/repl/fn--6672/fn--6673 (main.clj:266)
clojure.main/repl/fn--6672 (main.clj:266)
clojure.main/repl (main.clj:264)
clojure.tools.nrepl.middleware.interruptible-eval/evaluate/fn--938
(interruptible_eval.clj:58)
clojure.core/apply (core.clj:614)
clojure.core/with-bindings* (core.clj:1785)
clojure.tools.nrepl.middleware.interruptible-eval/evaluate
(interruptible_eval.clj:43)

clojure.tools.nrepl.middleware.interruptible-eval/interruptible-eval/fn--979/fn--982
(interruptible_eval.clj:173)
clojure.core/comp/fn--4092 (core.clj:2314)
clojure.tools.nrepl.middleware.interruptible-eval/run-next/fn--972
(interruptible_eval.clj:140)
java.util.concurrent.ThreadPoolExecutor.runWorker
(ThreadPoolExecutor.java:1110)
java.util.concurrent.ThreadPoolExecutor$Worker.run
(ThreadPoolExecutor.java:603)
java.lang.Thread.run (Thread.java:722)
Caused by:
Exception cause
cloj2.ka/eval1430 (NO_SOURCE_FILE:1)
clojure.lang.Compiler.eval (Compiler.java:6603)
nil

but this doesn't:
= *(try (throw (Exception. a (Exception. cause))) (catch Exception e
(throw e)))
   (pst 123912031)*
Exception cause  cloj2.ka/eval1434 (NO_SOURCE_FILE:1)
Exception cause
cloj2.ka/eval1434 (NO_SOURCE_FILE:1)
clojure.lang.Compiler.eval (Compiler.java:6603)
clojure.lang.Compiler.eval (Compiler.java:6566)
clojure.core/eval (core.clj:2836)
clojure.main/repl/read-eval-print--6667 (main.clj:245)
clojure.main/repl/fn--6672/fn--6673 (main.clj:266)
clojure.main/repl/fn--6672 (main.clj:266)
clojure.main/repl (main.clj:264)
clojure.tools.nrepl.middleware.interruptible-eval/evaluate/fn--938
(interruptible_eval.clj:58)
clojure.core/apply (core.clj:614)
clojure.core/with-bindings* (core.clj:1785)
clojure.tools.nrepl.middleware.interruptible-eval/evaluate
(interruptible_eval.clj:43)

clojure.tools.nrepl.middleware.interruptible-eval/interruptible-eval/fn--979/fn--982
(interruptible_eval.clj:173)
clojure.core/comp/fn--4092 (core.clj:2314)
clojure.tools.nrepl.middleware.interruptible-eval/run-next/fn--972
(interruptible_eval.clj:140)
java.util.concurrent.ThreadPoolExecutor.runWorker
(ThreadPoolExecutor.java:1110)
java.util.concurrent.ThreadPoolExecutor$Worker.run
(ThreadPoolExecutor.java:603)
java.lang.Thread.run (Thread.java:722)
nil


On Wed, Oct 24, 2012 at 3:27 PM, AtKaaZ atk...@gmail.com wrote:

 Here, (pst) doesn't see the thrown exception which is a, it's seeing
 only it's cause:

 = *(try (throw (Exception. a (Exception. cause))) (catch Exception e
 (throw e)))* *(pst 123912031)*
 Exception cause  datest1.core/eval3129 (NO_SOURCE_FILE:1)
 Exception cause
 datest1.core/eval3129 (NO_SOURCE_FILE:1)
 clojure.lang.Compiler.eval (Compiler.java:6603)
 clojure.lang.Compiler.eval (Compiler.java:6566)
 clojure.core/eval (core.clj:2836)
 clojure.main/repl/read-eval-print--6667 (main.clj:245)
 clojure.main/repl/fn--6672/fn--6673 (main.clj:266)
 clojure.main/repl/fn--6672 (main.clj:266)
 clojure.main/repl (main.clj:264)
 clojure.tools.nrepl.middleware.interruptible-eval/evaluate/fn--938
 (interruptible_eval.clj:58)
 clojure.core/apply (core.clj:614)
 clojure.core/with-bindings* (core.clj:1785)
 clojure.tools.nrepl.middleware.interruptible-eval/evaluate
 (interruptible_eval.clj:43)

 clojure.tools.nrepl.middleware.interruptible-eval/interruptible-eval/fn--979/fn--982
 

pst shows the cause instead of the last thrown ex thus it doesn't show the chain

2012-10-24 Thread AtKaaZ
Here, (pst) doesn't see the thrown exception which is a, it's seeing only
it's cause:

= *(try (throw (Exception. a (Exception. cause))) (catch Exception e
(throw e)))* *(pst 123912031)*
Exception cause  datest1.core/eval3129 (NO_SOURCE_FILE:1)
Exception cause
datest1.core/eval3129 (NO_SOURCE_FILE:1)
clojure.lang.Compiler.eval (Compiler.java:6603)
clojure.lang.Compiler.eval (Compiler.java:6566)
clojure.core/eval (core.clj:2836)
clojure.main/repl/read-eval-print--6667 (main.clj:245)
clojure.main/repl/fn--6672/fn--6673 (main.clj:266)
clojure.main/repl/fn--6672 (main.clj:266)
clojure.main/repl (main.clj:264)
clojure.tools.nrepl.middleware.interruptible-eval/evaluate/fn--938
(interruptible_eval.clj:58)
clojure.core/apply (core.clj:614)
clojure.core/with-bindings* (core.clj:1785)
clojure.tools.nrepl.middleware.interruptible-eval/evaluate
(interruptible_eval.clj:43)

clojure.tools.nrepl.middleware.interruptible-eval/interruptible-eval/fn--979/fn--982
(interruptible_eval.clj:173)
clojure.core/comp/fn--4092 (core.clj:2314)
clojure.tools.nrepl.middleware.interruptible-eval/run-next/fn--972
(interruptible_eval.clj:140)
java.util.concurrent.ThreadPoolExecutor.runWorker
(ThreadPoolExecutor.java:1110)
java.util.concurrent.ThreadPoolExecutor$Worker.run
(ThreadPoolExecutor.java:603)
java.lang.Thread.run (Thread.java:722)
nil

;or, the same thing with this:
= *(throw (Exception. a (Exception. cause)))*
Exception cause  datest1.core/eval3133 (NO_SOURCE_FILE:1)
= *(pst 21872912)*
Exception cause
datest1.core/eval3133 (NO_SOURCE_FILE:1)
clojure.lang.Compiler.eval (Compiler.java:6603)
clojure.lang.Compiler.eval (Compiler.java:6566)
clojure.core/eval (core.clj:2836)
clojure.main/repl/read-eval-print--6667 (main.clj:245)
clojure.main/repl/fn--6672/fn--6673 (main.clj:266)
clojure.main/repl/fn--6672 (main.clj:266)
clojure.main/repl (main.clj:264)
clojure.tools.nrepl.middleware.interruptible-eval/evaluate/fn--938
(interruptible_eval.clj:58)
clojure.core/apply (core.clj:614)
clojure.core/with-bindings* (core.clj:1785)
clojure.tools.nrepl.middleware.interruptible-eval/evaluate
(interruptible_eval.clj:43)

clojure.tools.nrepl.middleware.interruptible-eval/interruptible-eval/fn--979/fn--982
(interruptible_eval.clj:173)
clojure.core/comp/fn--4092 (core.clj:2314)
clojure.tools.nrepl.middleware.interruptible-eval/run-next/fn--972
(interruptible_eval.clj:140)
java.util.concurrent.ThreadPoolExecutor.runWorker
(ThreadPoolExecutor.java:1110)
java.util.concurrent.ThreadPoolExecutor$Worker.run
(ThreadPoolExecutor.java:603)
java.lang.Thread.run (Thread.java:722)
nil

But here, (pst) shows the exceptions correctly (chained) shows the last
thrown exception which is a and it's cause:
= *(pst (try (throw (Exception. a (Exception. cause))) (catch
Exception e e)))*
Exception a
datest1.core/eval3125/fn--3126 (NO_SOURCE_FILE:1)
datest1.core/eval3125 (NO_SOURCE_FILE:1)
clojure.lang.Compiler.eval (Compiler.java:6603)
clojure.lang.Compiler.eval (Compiler.java:6566)
clojure.core/eval (core.clj:2836)
clojure.main/repl/read-eval-print--6667 (main.clj:245)
clojure.main/repl/fn--6672/fn--6673 (main.clj:266)
clojure.main/repl/fn--6672 (main.clj:266)
clojure.main/repl (main.clj:264)
clojure.tools.nrepl.middleware.interruptible-eval/evaluate/fn--938
(interruptible_eval.clj:58)
clojure.core/apply (core.clj:614)
clojure.core/with-bindings* (core.clj:1785)
Caused by:
Exception cause
datest1.core/eval3125/fn--3126 (NO_SOURCE_FILE:1)
datest1.core/eval3125 (NO_SOURCE_FILE:1)
nil

So what is going on here? Bug ?

= *clojure-version*
{:major 1, :minor 5, :incremental 0, :qualifier alpha6}

I also just tested with alpha7, same thing.

-- 
I may be wrong or incomplete.
Please express any corrections / additions,
they are encouraged and appreciated.
At least one entity is bound to be transformed if you do ;)

-- 
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: No show?

2012-02-12 Thread John Szakmeister
On Sat, Feb 11, 2012 at 10:15 PM, Sean Corfield seancorfi...@gmail.com wrote:
 On Sat, Feb 11, 2012 at 6:30 PM, Michał Marczyk
 michal.marc...@gmail.com wrote:
 print-table expects a sequence of maps, e.g.

 (print-table (:members (reflect Math)))

 Wow! I had no idea how useful that could be... Learn something new
 every day! (and, lately, that's a new Clojure function every day...)

That is amazing!   Thanks for the tip Michał!

-John

-- 
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: No show?

2012-02-11 Thread Ken Restivo
On Thu, Feb 09, 2012 at 11:41:31AM -0400, Stuart Halloway wrote:
  clojure.reflect/reflect gets you the same information as a big 'ole data 
  structure. You can pprint it for readability.
  
  The only thing that was not ported was the formatted text output, which 
  would be easy enough to reproduce based on `reflect`.
 
 In particular, reflect + clojure.pprint/print-table.


= (require 'clojure.reflect)
nil
= (require 'clojure.pprint)
nil
= (clojure.pprint/print-table (clojure.reflect/reflect Math))
ClassCastException clojure.lang.Keyword cannot be cast to java.util.Map$Entry  
clojure.lang.APersistentMap$KeySeq.first (APersistentMap.java:132)

But reflect is useful enough just as a map, so problem solved, thanks!

-ken

-- 
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: No show?

2012-02-11 Thread Michał Marczyk
On 11 February 2012 10:35, Ken Restivo k...@restivo.org wrote:
 = (clojure.pprint/print-table (clojure.reflect/reflect Math))
 ClassCastException clojure.lang.Keyword cannot be cast to java.util.Map$Entry 
  clojure.lang.APersistentMap$KeySeq.first (APersistentMap.java:132)

print-table expects a sequence of maps, e.g.

(print-table (:members (reflect Math)))

or

(print-table (:members (reflect Math :ancestors true)))

to include inherited members.

Sincerely,
Michał

-- 
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: No show?

2012-02-11 Thread Sean Corfield
On Sat, Feb 11, 2012 at 6:30 PM, Michał Marczyk
michal.marc...@gmail.com wrote:
 print-table expects a sequence of maps, e.g.

 (print-table (:members (reflect Math)))

Wow! I had no idea how useful that could be... Learn something new
every day! (and, lately, that's a new Clojure function every day...)
-- 
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: No show?

2012-02-09 Thread Stuart Halloway
 clojure.reflect/reflect gets you the same information as a big 'ole data 
 structure. You can pprint it for readability.
 
 The only thing that was not ported was the formatted text output, which would 
 be easy enough to reproduce based on `reflect`.

In particular, reflect + clojure.pprint/print-table.

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

No show?

2012-02-08 Thread Ken Restivo
Hi all,

I'm curious why the show function got abandoned when migrating from monolithic
contrib.repl-utils to clojure.repl?

http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go

It looks like it would have been useful. Does anything replace it?

Thanks.

-ken

-- 
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: No show?

2012-02-08 Thread Stuart Sierra
clojure.reflect/reflect gets you the same information as a big 'ole data 
structure. You can pprint it for readability.

The only thing that was not ported was the formatted text output, which 
would be easy enough to reproduce based on `reflect`.

-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

clojure.contrib.repl-utils/show breaks with NoSubMethodError

2011-11-25 Thread Curious Fox
Hi,

I keep running into NoSuchMethodError on any call to
clojure.contrib.repl-utils/show in REPL with clojure 1.3.0:

$ lein repl

= (use 'clojure.contrib.repl-utils)
;; bunch of warnings skipped

= (clojure.contrib.repl-utils/show 1)
NoSuchMethodError clojure.lang.Numbers.lt(Ljava/lang/Object;I)Z
clojure.contrib.string/partition/step--78/fn--79 (string.clj:225)

user= (clojure.contrib.repl-utils/show Integer)
NoSuchMethodError clojure.lang.Numbers.lt(Ljava/lang/Object;I)Z
clojure.contrib.string/partition/step--78/fn--79 (string.clj:225)

user= (clojure.contrib.repl-utils/show (Object.))
NoSuchMethodError clojure.lang.Numbers.lt(Ljava/lang/Object;I)Z
clojure.contrib.string/partition/step--78/fn--79 (string.clj:225)

Am I doing it wrong?

Thank you,
- F

-- 
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.contrib.repl-utils/show breaks with NoSubMethodError

2011-11-25 Thread Sean Corfield
On Fri, Nov 25, 2011 at 3:00 PM, Curious Fox fra...@gmail.com wrote:
 I keep running into NoSuchMethodError on any call to
 clojure.contrib.repl-utils/show in REPL with clojure 1.3.0:

The old contrib libraries are, for the most part, deprecated and not
guaranteed to work with Clojure 1.3.0.

See http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go

So far no one has stepped up to volunteer to maintain / migrate
c.c.repl-utils (assuming Clojure/core believe it is of sufficient
quality to warrent migrating to the new setup - some contrib libraries
are not).
-- 
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: clojure.contrib.repl-utils/show breaks with NoSubMethodError

2011-11-25 Thread Curious Fox

Oh, I see.

Do you know by any chance is there any equivalent to
clojure.contrib.repl-utils/show in the new set of libraries?

I.e. is there a standard and recommended way to inspect all object's
properties and methods in REPL?


Thanks again,
- F


On Nov 25, 4:44 pm, Sean Corfield seancorfi...@gmail.com wrote:
 On Fri, Nov 25, 2011 at 3:00 PM, Curious Fox fra...@gmail.com wrote:
  I keep running into NoSuchMethodError on any call to
  clojure.contrib.repl-utils/show in REPL with clojure 1.3.0:

 The old contrib libraries are, for the most part, deprecated and not
 guaranteed to work with Clojure 1.3.0.

 Seehttp://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go

 So far no one has stepped up to volunteer to maintain / migrate
 c.c.repl-utils (assuming Clojure/core believe it is of sufficient
 quality to warrent migrating to the new setup - some contrib libraries
 are not).
 --
 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: clojure.contrib.repl-utils/show breaks with NoSubMethodError

2011-11-25 Thread Sean Corfield
On Fri, Nov 25, 2011 at 5:09 PM, Curious Fox fra...@gmail.com wrote:
 Do you know by any chance is there any equivalent to
 clojure.contrib.repl-utils/show in the new set of libraries?

 I.e. is there a standard and recommended way to inspect all object's
 properties and methods in REPL?

Take a look at clojure.reflect/reflect which returns a Clojure data
structure describing the object.

For example:

((comp (partial map :name) :members) (clojure.reflect/reflect str))

yields:

(valueOf java.lang.String regionMatches valueOf java.lang.String
indexOf getBytes toUpperCase lastIndexOf contentEquals endsWith
indexOf startsWith valueOf split valueOf indexOf valueOf replace
replace toLowerCase getChars java.lang.String java.lang.String
java.lang.String codePointBefore java.lang.String java.lang.String
indexOf offsetByCodePoints contains hashCode java.lang.String
compareTo toLowerCase checkBounds compareTo lastIndexOf getBytes
intern lastIndexOf getBytes replaceFirst subSequence count equals
valueOf codePointAt isEmpty valueOf getBytes lastIndexOf copyValueOf
contentEquals copyValueOf replaceAll startsWith format trim
java.lang.String getChars lastIndexOf split java.lang.String indexOf
value java.lang.String regionMatches java.lang.String substring
java.lang.String valueOf concat java.lang.String matches
java.lang.String CASE_INSENSITIVE_ORDER length charAt valueOf toString
serialVersionUID equalsIgnoreCase toCharArray hash offset
serialPersistentFields compareToIgnoreCase toUpperCase
java.lang.String format substring codePointCount)

(filter #(:static (:flags %)) (:members (reflect str)))

will yield all the static members (with all metadata).

etc.
-- 
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: clojure.contrib.repl-utils show

2010-06-02 Thread looselytyped
Hello!

I figured it out. For the record, it was me being stupid about it. The
problem was doing a (use 'clojure.contrib.repl-utils) would barf
because 'source' is declared in both clojure.repl and
clojure.contrib.repl-utils (This has probably to do with what Sean
said - some repl functions are being promoted to core).

I needed to do a (use '[clojure.contrib.repl-utils :only (show)]) -
this way the name collision would be avoided. (I am not sure why emacs
tab-autocomplete would not show repl-utils as an option, but it may
have to do with the collision).

The lab-repl script loads the 'show' function this way. That's why it
worked with lab-repl but not with a 'lein swank' since with lein I
have to explicitly 'use' any contrib libraries.

I am sorry for the confusion. Please forgive me.

Warm regards,

Raju

On Jun 1, 5:14 pm, looselytyped raju.gan...@gmail.com wrote:
 Hi Sean,

 Yes, it certainly looks like it's being pulled into clojure core.
 Thank you for the response.

 If I may say so - I think your series on vimeo is awesome. Thank you
 for taking the time and making the effort.

 Kind regards,

 Raju

 On Jun 1, 11:13 am, Sean Devlin francoisdev...@gmail.com wrote:

  Keep in mind thatREPL-utils is being discussed for inclusion in core
  in 1.2.  Therefore, any edge build will have to pay extra attention to
  what is going on.  This will be easier to track when frozen betas 
  RC's come out.

  Sean

  On Jun 1, 10:52 am, looselytyped raju.gan...@gmail.com wrote:

   Hi Meikel,

   Thank you for the response. I did not do that, but a quick glance at
   the clojure.contribgithub repo tells me there is no 'show' function
   in it. I will try it at home (it's on my home computer).

   It's odd because it was working just fine - then I did a 'lein clean'
   and 'lein deps' and it was then I could not refer to 'show'.

   Kind regards,
   Raju

   On Jun 1, 1:28 am, Meikel Brandmeyer m...@kotka.de wrote:

Hi,

On Jun 1, 4:16 am, looselytyped raju.gan...@gmail.com wrote:

 For some reason, the 'show' function from clojure.contrib.repl-utils
 does not work. In fact the only completions I get when trying to get
 torepl-* are

 clojure.contrib.repl-ln
 clojure.contrib.repl_ln

Did you (require 'clojure.contrib.repl-ln)? Maybe
labrepl does that for you.

Sincerely
Meikel

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


Re: clojure.contrib.repl-utils show

2010-06-02 Thread looselytyped
Hello!

I figured it out. For the record, it was me being stupid about it. The
problem was doing a (use 'clojure.contrib.repl-utils) would barf
because 'source' is declared in both clojure.repl and
clojure.contrib.repl-utils (This has probably to do with what Sean
said - some repl functions are being promoted to core).

I needed to do a (use '[clojure.contrib.repl-utils :only (show)]) -
this way the name collision would be avoided. (I am not sure why emacs
tab-autocomplete would not show repl-utils as an option, but it may
have to do with the collision).

The lab-repl script loads the 'show' function this way. That's why it
worked with lab-repl but not with a 'lein swank' since with lein I
have to explicitly 'use' any contrib libraries.

I am sorry for the confusion. Please forgive me.

Warm regards,

Raju

On Jun 1, 5:14 pm, looselytyped raju.gan...@gmail.com wrote:
 Hi Sean,

 Yes, it certainly looks like it's being pulled into clojure core.
 Thank you for the response.

 If I may say so - I think your series on vimeo is awesome. Thank you
 for taking the time and making the effort.

 Kind regards,

 Raju

 On Jun 1, 11:13 am, Sean Devlin francoisdev...@gmail.com wrote:

  Keep in mind thatREPL-utils is being discussed for inclusion in core
  in 1.2.  Therefore, any edge build will have to pay extra attention to
  what is going on.  This will be easier to track when frozen betas 
  RC's come out.

  Sean

  On Jun 1, 10:52 am, looselytyped raju.gan...@gmail.com wrote:

   Hi Meikel,

   Thank you for the response. I did not do that, but a quick glance at
   the clojure.contribgithub repo tells me there is no 'show' function
   in it. I will try it at home (it's on my home computer).

   It's odd because it was working just fine - then I did a 'lein clean'
   and 'lein deps' and it was then I could not refer to 'show'.

   Kind regards,
   Raju

   On Jun 1, 1:28 am, Meikel Brandmeyer m...@kotka.de wrote:

Hi,

On Jun 1, 4:16 am, looselytyped raju.gan...@gmail.com wrote:

 For some reason, the 'show' function from clojure.contrib.repl-utils
 does not work. In fact the only completions I get when trying to get
 torepl-* are

 clojure.contrib.repl-ln
 clojure.contrib.repl_ln

Did you (require 'clojure.contrib.repl-ln)? Maybe
labrepl does that for you.

Sincerely
Meikel

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


Re: clojure.contrib.repl-utils show

2010-06-01 Thread looselytyped
Hi Meikel,

Thank you for the response. I did not do that, but a quick glance at
the clojure.contrib github repo tells me there is no 'show' function
in it. I will try it at home (it's on my home computer).

It's odd because it was working just fine - then I did a 'lein clean'
and 'lein deps' and it was then I could not refer to 'show'.

Kind regards,
Raju

On Jun 1, 1:28 am, Meikel Brandmeyer m...@kotka.de wrote:
 Hi,

 On Jun 1, 4:16 am, looselytyped raju.gan...@gmail.com wrote:

  For some reason, the 'show' function from clojure.contrib.repl-utils
  does not work. In fact the only completions I get when trying to get
  torepl-* are

  clojure.contrib.repl-ln
  clojure.contrib.repl_ln

 Did you (require 'clojure.contrib.repl-ln)? Maybe
 labrepl does that for you.

 Sincerely
 Meikel

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


Re: clojure.contrib.repl-utils show

2010-06-01 Thread Sean Devlin
Keep in mind that REPL-utils is being discussed for inclusion in core
in 1.2.  Therefore, any edge build will have to pay extra attention to
what is going on.  This will be easier to track when frozen betas 
RC's come out.

Sean

On Jun 1, 10:52 am, looselytyped raju.gan...@gmail.com wrote:
 Hi Meikel,

 Thank you for the response. I did not do that, but a quick glance at
 the clojure.contrib github repo tells me there is no 'show' function
 in it. I will try it at home (it's on my home computer).

 It's odd because it was working just fine - then I did a 'lein clean'
 and 'lein deps' and it was then I could not refer to 'show'.

 Kind regards,
 Raju

 On Jun 1, 1:28 am, Meikel Brandmeyer m...@kotka.de wrote:

  Hi,

  On Jun 1, 4:16 am, looselytyped raju.gan...@gmail.com wrote:

   For some reason, the 'show' function from clojure.contrib.repl-utils
   does not work. In fact the only completions I get when trying to get
   torepl-* are

   clojure.contrib.repl-ln
   clojure.contrib.repl_ln

  Did you (require 'clojure.contrib.repl-ln)? Maybe
  labrepl does that for you.

  Sincerely
  Meikel

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


Re: clojure.contrib.repl-utils show

2010-06-01 Thread looselytyped
Hi Sean,

Yes, it certainly looks like it's being pulled into clojure core.
Thank you for the response.

If I may say so - I think your series on vimeo is awesome. Thank you
for taking the time and making the effort.

Kind regards,

Raju

On Jun 1, 11:13 am, Sean Devlin francoisdev...@gmail.com wrote:
 Keep in mind that REPL-utils is being discussed for inclusion in core
 in 1.2.  Therefore, any edge build will have to pay extra attention to
 what is going on.  This will be easier to track when frozen betas 
 RC's come out.

 Sean

 On Jun 1, 10:52 am, looselytyped raju.gan...@gmail.com wrote:



  Hi Meikel,

  Thank you for the response. I did not do that, but a quick glance at
  the clojure.contrib github repo tells me there is no 'show' function
  in it. I will try it at home (it's on my home computer).

  It's odd because it was working just fine - then I did a 'lein clean'
  and 'lein deps' and it was then I could not refer to 'show'.

  Kind regards,
  Raju

  On Jun 1, 1:28 am, Meikel Brandmeyer m...@kotka.de wrote:

   Hi,

   On Jun 1, 4:16 am, looselytyped raju.gan...@gmail.com wrote:

For some reason, the 'show' function from clojure.contrib.repl-utils
does not work. In fact the only completions I get when trying to get
torepl-* are

clojure.contrib.repl-ln
clojure.contrib.repl_ln

   Did you (require 'clojure.contrib.repl-ln)? Maybe
   labrepl does that for you.

   Sincerely
   Meikel

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


clojure.contrib.repl-utils show

2010-05-31 Thread looselytyped
Hi!

I created a new project using 'lein new project_name and then
modified the project.clj file to look like this -


(defproject datastructures 1.0.0-SNAPSHOT
:dependencies [[org.clojure/clojure 1.2.0-master-SNAPSHOT]
 [org.clojure/clojure-contrib 1.2.0-SNAPSHOT]
 [ant/ant 1.6.5]
 [jline 0.9.94]
 [org.apache.maven/maven-ant-tasks 2.0.10]]
  :dev-dependencies [[swank-clojure 1.2.1]
 [autodoc 0.7.0]])


I did a 'lein deps' and then a 'lein swank' - I switched over the
emacs and did a slime-connect [I am using the emacs-starter-kit with
clojure-mode, and swank-clojure installed via ELPA).

For some reason, the 'show' function from clojure.contrib.repl-utils
does not work. In fact the only completions I get when trying to get
to repl-* are

clojure.contrib.repl-ln
clojure.contrib.repl_ln

I noticed that there is now a clojure.repl namespace with a few
methods like apropos but no 'show'.

Furthermore, when using labrepl (from relevance) and doing a script/
swank 'show' works just fine.

Both lib directories contain the same jars

labrepl/lib = clojure-1.2.0-master-20100528.120302-79.jar
clojure-contrib-1.2.0-20100528.120551-119.jar
new_project/lib = clojure-1.2.0-master-20100528.120302-79.jar
clojure-contrib-1.2.0-20100528.120551-119.jar

Is there something I am missing?

Thank you!

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


Re: clojure.contrib.repl-utils show

2010-05-31 Thread Meikel Brandmeyer
Hi,

On Jun 1, 4:16 am, looselytyped raju.gan...@gmail.com wrote:

 For some reason, the 'show' function from clojure.contrib.repl-utils
 does not work. In fact the only completions I get when trying to get
 to repl-* are

 clojure.contrib.repl-ln
 clojure.contrib.repl_ln

Did you (require 'clojure.contrib.repl-ln)? Maybe
labrepl does that for you.

Sincerely
Meikel

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


Re: Project Euler: Problem suggestions that show off clojure?

2009-10-16 Thread Meikel Brandmeyer

Hi,

You can have a look here: http://clojure-euler.wikispaces.com.

I chose the problems I solved because I found them interesting or
because I had an idea how to solve them. I didn't look specifically
for problems fitting to Clojure. (And in fact most of my solution look
rather ugly when now looking at them...)

Sincerely
Meikel

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



Re: repl-utils show

2009-01-21 Thread Chouser

On Wed, Jan 21, 2009 at 12:05 AM, Chouser chou...@gmail.com wrote:

 The predicate takes a map based on the 'bean' of the member object,
 but with :text and :member keys added.  The :text is what will be
 printed, the :member is the original member object itself.

This means that (as of clojure svn 1221) you can filter directly on
member properties, like this:

user= (show String :varArgs)
===  public final java.lang.String  ===
[ 3] static format : String (Locale,String,Object[])
[ 4] static format : String (String,Object[])
nil

user= (show 321 :bridge)
===  public final java.lang.Integer  ===
[32] compareTo : int (Object)
nil

--Chouser

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



Re: repl-utils show

2009-01-21 Thread Mark Volkmann

On Wed, Jan 21, 2009 at 7:44 AM, Chouser chou...@gmail.com wrote:

 On Wed, Jan 21, 2009 at 12:05 AM, Chouser chou...@gmail.com wrote:

 The predicate takes a map based on the 'bean' of the member object,
 but with :text and :member keys added.  The :text is what will be
 printed, the :member is the original member object itself.

 This means that (as of clojure svn 1221) you can filter directly on
 member properties, like this:

 user= (show String :varArgs)

What is this asking show to do? Find all methods in java.lang.String
that take a variable number of arguments?

 ===  public final java.lang.String  ===
 [ 3] static format : String (Locale,String,Object[])
 [ 4] static format : String (String,Object[])
 nil

 user= (show 321 :bridge)

I have no guess what this is asking for.

 ===  public final java.lang.Integer  ===
 [32] compareTo : int (Object)
 nil

-- 
R. Mark Volkmann
Object Computing, Inc.

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



Re: repl-utils show

2009-01-21 Thread Chouser

On Wed, Jan 21, 2009 at 9:52 AM, Mark Volkmann
r.mark.volkm...@gmail.com wrote:

 On Wed, Jan 21, 2009 at 7:44 AM, Chouser chou...@gmail.com wrote:

 On Wed, Jan 21, 2009 at 12:05 AM, Chouser chou...@gmail.com wrote:

 The predicate takes a map based on the 'bean' of the member object,
 but with :text and :member keys added.  The :text is what will be
 printed, the :member is the original member object itself.

 This means that (as of clojure svn 1221) you can filter directly on
 member properties, like this:

 user= (show String :varArgs)

 What is this asking show to do? Find all methods in java.lang.String
 that take a variable number of arguments?

Yep.

 ===  public final java.lang.String  ===
 [ 3] static format : String (Locale,String,Object[])
 [ 4] static format : String (String,Object[])
 nil

 user= (show 321 :bridge)

 I have no guess what this is asking for.

It will list all the bridge methods. :-)

The JavaDoc says: Bridge methods are defined in the JavaTM
Language Specification, 3rd Edition.

http://java.sun.com/j2se/1.5.0/docs/guide/jpda/jdi/com/sun/jdi/Method.html#isBridge()

--Chouser

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



Re: repl-utils show

2009-01-21 Thread Mark Volkmann

On Wed, Jan 21, 2009 at 9:18 AM, Chouser chou...@gmail.com wrote:

 On Wed, Jan 21, 2009 at 9:52 AM, Mark Volkmann
 r.mark.volkm...@gmail.com wrote:

 On Wed, Jan 21, 2009 at 7:44 AM, Chouser chou...@gmail.com wrote:

 On Wed, Jan 21, 2009 at 12:05 AM, Chouser chou...@gmail.com wrote:

 The predicate takes a map based on the 'bean' of the member object,
 but with :text and :member keys added.  The :text is what will be
 printed, the :member is the original member object itself.

 This means that (as of clojure svn 1221) you can filter directly on
 member properties, like this:

 user= (show String :varArgs)

 What is this asking show to do? Find all methods in java.lang.String
 that take a variable number of arguments?

 Yep.

 ===  public final java.lang.String  ===
 [ 3] static format : String (Locale,String,Object[])
 [ 4] static format : String (String,Object[])
 nil

 user= (show 321 :bridge)

 I have no guess what this is asking for.

 It will list all the bridge methods. :-)

What does 321 represent?

 The JavaDoc says: Bridge methods are defined in the JavaTM
 Language Specification, 3rd Edition.

 http://java.sun.com/j2se/1.5.0/docs/guide/jpda/jdi/com/sun/jdi/Method.html#isBridge()

Geez. No wonder I didn't know what it was. It's related to generics
erasure. See section 15.12.4.5 in the Java Language Specification, 3rd
Edition.

-- 
R. Mark Volkmann
Object Computing, Inc.

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



Re: repl-utils show

2009-01-21 Thread Chouser

On Wed, Jan 21, 2009 at 10:29 AM, Mark Volkmann
r.mark.volkm...@gmail.com wrote:

 What does 321 represent?

user= (show 321 :bridge)
===  public final java.lang.Integer  ===
[32] compareTo : int (Object)
nil

321 is an Integer literal.  When 'show' sees a non-class as its first
argument, it fetchs the object's class and operates on that instead.
Hence the banner line that says public final java.lang.Integer

This is useful when you're not sure what class you're actually dealing
with, and are too lazy to type (class  and ) yourself:

user= (show 42M pow)
===  public java.math.BigDecimal  ===
[69] pow : BigDecimal (int)
[70] pow : BigDecimal (int,MathContext)
[76] scaleByPowerOfTen : BigDecimal (int)
nil

Look, it's a BigDecimal!  Hm, I wonder if hash-maps have a run()
method:

user= (show {} run)
===  public clojure.lang.PersistentArrayMap  ===
[56] run : void ()
nil

Wait, that's not a hash-map, it's an array-map.  And it does have a
run(), though I can't imagine how I'd use it.  But what about a real
hash-map, does it have any methods that take variable arguments?

user= (show (hash-map) :varArgs)
===  public clojure.lang.PersistentArrayMap  ===
[44] invoke : Object (Object*20,Object[])
nil

There's that array-map again.  Let's try the class explicitly, then:

user= (show clojure.lang.PersistentHashMap :varArgs)
===  public clojure.lang.PersistentHashMap  ===
[ 3] static create : PersistentHashMap (IPersistentMap,Object[])
[ 6] static create : PersistentHashMap (Object[])
[45] invoke : Object (Object*20,Object[])
nil

Ah, much better.  But that was too much to type.  Next time I'm going
to use (hash-map :a 1) instead.  Maybe it has a method that returns a
boolean:

user= (show (hash-map :a 1) #(= (:returnType %) Boolean/TYPE))
===  public clojure.lang.PersistentHashMap  ===
[15] containsKey : boolean (Object)
[16] containsValue : boolean (Object)
[21] equals : boolean (Object)
[22] equiv : boolean (Object)
[48] isEmpty : boolean ()
nil

Oh, I wonder if that containsKey() method is public.  It's marked as
number [15], so:

user= (show (hash-map :a 1) 15)
#Method public boolean
clojure.lang.PersistentHashMap.containsKey(java.lang.Object)

Good, it *is* public...  and so on...

--Chouser

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



Re: repl-utils show

2009-01-20 Thread Chouser

On Mon, Jan 19, 2009 at 1:09 PM, Stuart Sierra
the.stuart.sie...@gmail.com wrote:

 On Jan 19, 11:59 am, Chouser chou...@gmail.com wrote:
 But my version also only allows matches on the method name (not on
 return value or argument class names).  At first I thought this was
 also good, but now I'm less sure.  How often do you think you'd want
 to be able to search on a method's argument names, vs. how many
 unhelpful matches you'd get doing (show String string) ?  Opintions?

  Would it be possible to separate show into two functions, one of
 which returns a sequence of method signatures and another which prints
 them?  Then you could filter the sequence however you like.

As of SVN 397, show accepts a string, regex, or predicate in addition
to still accepting a number for its second arg.  The number works as
before, returning the member object itself.

A string or regex will act as a case-insensitive filter on the name of
the member:

user= (show Thread stop) ; all members named stop
===  public java.lang.Thread  ===
[54] stop : void ()
[55] stop : void (Throwable)
nil

user= (show Thread #^\w{5}$) ; all members with 5-letter names
===  public java.lang.Thread  ===
[12] static sleep : void (long)
[13] static sleep : void (long,int)
[14] static yield : void ()
[29] getId : long ()
[53] start : void ()
nil

I find it very unlikely that anyone would bother being any more
specific than this.  But just in case, you can also provide a
predicate function:

; all methods that take exactly two ints
user= (show Integer #(re-seq #\(int,int\) (:text %)))
===  public final java.lang.Integer  ===
[17] static rotateLeft : int (int,int)
[18] static rotateRight : int (int,int)
[24] static toString : String (int,int)
nil

The predicate takes a map based on the 'bean' of the member object,
but with :text and :member keys added.  The :text is what will be
printed, the :member is the original member object itself. It ends up
looking like this:

{:name intValue,
 :text intValue : int (),
 :class java.lang.reflect.Method,
 :member #Method public int java.lang.Integer.intValue(),
 :returnType int,
 :accessible false,
 :annotations #Annotation[] [Ljava.lang.annotation.Annotation;@46d228,
 :bridge false,
 :declaredAnnotations #Annotation[] [Ljava.lang.annotation.Annotation;@46d228,
 :declaringClass java.lang.Integer,
 :defaultValue nil,
 :exceptionTypes #Class[] [Ljava.lang.Class;@182ef6b,
 :genericExceptionTypes #Class[] [Ljava.lang.Class;@1980630,
 :genericParameterTypes #Class[] [Ljava.lang.Class;@e34726,
 :genericReturnType int,
 :modifiers 1,
 :parameterAnnotations #Annotation[][]
[[Ljava.lang.annotation.Annotation;@e99681,
 :parameterTypes #Class[] [Ljava.lang.Class;@1d32e45,
 :sort-val [true true intValue : int ()],
 :synthetic false,
 :typeParameters #TypeVariable[] [Ljava.lang.reflect.TypeVariable;@1e12f6d,
 :varArgs false}

Thank you all for you input.
--Chouser

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



Re: repl-utils show

2009-01-19 Thread Chouser

On Sat, Jan 17, 2009 at 8:03 PM, pc peng2che...@yahoo.com wrote:

 This is very useful. For me it was useful to be able to limit the
 output to lines that contained a few selected letters.

 (show String pper)
 ===  public final java.lang.String  ===
 [82] toUpperCase : String ()
 [83] toUpperCase : String (Locale)
 nil

This is a good idea, thanks.  I've got a version here that allows
a full regex match, and is by default case-insensitive.  I think both
these are good.

But my version also only allows matches on the method name (not on
return value or argument class names).  At first I thought this was
also good, but now I'm less sure.  How often do you think you'd want
to be able to search on a method's argument names, vs. how many
unhelpful matches you'd get doing (show String string) ?  Opintions?

--Chouser

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



Re: repl-utils show

2009-01-19 Thread Michael Reid

On Mon, Jan 19, 2009 at 11:59 AM, Chouser chou...@gmail.com wrote:

 On Sat, Jan 17, 2009 at 8:03 PM, pc peng2che...@yahoo.com wrote:

 This is very useful. For me it was useful to be able to limit the
 output to lines that contained a few selected letters.

 (show String pper)
 ===  public final java.lang.String  ===
 [82] toUpperCase : String ()
 [83] toUpperCase : String (Locale)
 nil

 This is a good idea, thanks.  I've got a version here that allows
 a full regex match, and is by default case-insensitive.  I think both
 these are good.

 But my version also only allows matches on the method name (not on
 return value or argument class names).  At first I thought this was
 also good, but now I'm less sure.  How often do you think you'd want
 to be able to search on a method's argument names, vs. how many
 unhelpful matches you'd get doing (show String string) ?  Opintions?

 --Chouser


My feeling is that you'd want to search on arguments infrequently
enough compared to searching on method name that its worth defaulting
to only search on the method name.

For the case where you might want to search on method names maybe we
could look at some sort of composable approach. I'm thinking along the
lines of the Unix pipeline approach. Extremely rough pseudo-code of
what I'm getting at:

(- (show String case) (grep locale))

to find the methods containing the regexp 'case' and then further
constraining that to those entries that match the regexp 'locale'.
I've also assumed case insensitivity here as I think that makes sense
in this context.

Then again maybe this is a classic case of overdesign.

Perhaps it is easier in the short term to just be pragmatic and create
an overload for show that accepts a third argument to search on
argument/return  names and types:

(show String case locale)

or:

(show String * locale)

for all methods dealing with arguments or return types of locale or
arguments named locale.

/mike.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Clojure group.
To post to this group, send email to clojure@googlegroups.com
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: repl-utils show

2009-01-19 Thread Stuart Sierra

On Jan 19, 11:59 am, Chouser chou...@gmail.com wrote:
 But my version also only allows matches on the method name (not on
 return value or argument class names).  At first I thought this was
 also good, but now I'm less sure.  How often do you think you'd want
 to be able to search on a method's argument names, vs. how many
 unhelpful matches you'd get doing (show String string) ?  Opintions?

 Would it be possible to separate show into two functions, one of
which returns a sequence of method signatures and another which prints
them?  Then you could filter the sequence however you like.

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



repl-utils show

2009-01-17 Thread pc

This is very useful. For me it was useful to be able to limit the
output to lines that contained a few selected letters.

(show String pper)
===  public final java.lang.String  ===
[82] toUpperCase : String ()
[83] toUpperCase : String (Locale)
nil

I could always C-C C-O to flush the long output, but I still
had to look through it. The change is obvious, but I'll copy it in
anyway. If you do change it, I can learn how to do it right. Thanks
again.

(defn show
  With one arg, lists all static and instance members of the given
  class, or the class of the given object.  Each entry is listed with
  a number.  Use that number as the second argument, and that member
  will be returned which at the REPL can be used to get  more detail
  Use a String as the second argument to limit output to strings
  that contain the second argument.

  Examples: (show Integer)  (show [])  (show String 23) (show String
substr)
  ([x] (show x nil))
  ([x int-or-str]
  (let [c (if (class? x) x (class x))
items (sort (for [m (concat (.getFields c)
(.getMethods c)
(.getConstructors c))]
  (member-vec m)))]
(if (instance? Number int-or-str)
  (last (nth items int-or-str))
  (do
(println ===  (Modifier/toString (.getModifiers c)) c 
===)
(doseq [[i e] (indexed items)]
(if (or (nil? int-or-str) (.contains (second e) int-or-str))
  (printf [%2d] %s\n i (second e)


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



Re: Updated 'show' and 'source'

2008-12-13 Thread Mark Volkmann

On Sat, Dec 13, 2008 at 6:39 PM, Chouser chou...@gmail.com wrote:

 On Sat, Dec 13, 2008 at 4:46 PM, Mark Volkmann
 r.mark.volkm...@gmail.com wrote:

 I just updated to the latest version of clojure-contrib.  show works
 for me, but source doesn't. Here's what I did.

 (require 'clojure.contrib.repl-utils)
 (show 1/2) ; gives the output you show above

 You must be getting 'show' from somewhere else, as 'require' won't
 bring it into your namespace.  Perhaps you have an older 'show' in
 user.clj or something.

That was exactly it. In fact I'm pretty sure I got my definition of
show from you a few weeks ago. ;-)

 Try: (use 'clojure.contrib.repl-utils) instead.

 Also note that you must have the .clj sources in your classpath for
 'source' to work.  I thought that they were no longer included in the
 clojure.jar, but checking just now they appear to still be there.
 Anyway, if 'source' prints Source not found for a Var you know to be
 defined and 'refer'ed correctly, it may be because the .clj file
 defining it is not in your classpath.

Thanks! Everything is working now. I just put (use
'clojure.contrib.repl-utils) in my user.clj so I can always use those.

-- 
R. Mark Volkmann
Object Computing, Inc.

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



Updated 'show' and 'source'

2008-12-12 Thread Chouser

I've added updated versions of 'show' and 'source' to a new lib named
clojure.contrib.repl-utils

'show' is for exploring classes at the REPL.  What's new is that it
now displays the modifiers of the class and the parameter types for
each method.

'source' tries to display the Clojure source for any Var.  It now
sports more robust logic for finding the source file and determining
the end of the Var's definition.

user= (show 1/2)
===  public clojure.lang.Ratio  ===
[ 0] init (BigInteger,BigInteger)
[ 1] denominator : BigInteger
[ 2] numerator : BigInteger
[ 3] byteValue : byte ()
[ 4] compareTo : int (Object)
[ 5] doubleValue : double ()
[ 6] equals : boolean (Object)
[ 7] floatValue : float ()
[ 8] getClass : Class ()
[ 9] hashCode : int ()
[10] intValue : int ()
[11] longValue : long ()
[12] notify : void ()
[13] notifyAll : void ()
[14] shortValue : short ()
[15] toString : String ()
[16] wait : void ()
[17] wait : void (long)
[18] wait : void (long,int)

Note that 'show' takes instances or classes.  Members are sorted by
kind: static fields, static methods, constructors, instance fields,
instance methods.  Note that parameter package names and method
modifiers are not displayed for brevity.  For complete details on a
member, append its number to the call:

user= (show 1/2 3)
#Method public byte java.lang.Number.byteValue()

This actually returns the method itself, and so can be used to
construct more complex introspection expressions:

user= (show (.getType (show 1/2 1)))
===  public java.math.BigInteger  ===
[ 0] static ONE : BigInteger
[ 1] static TEN : BigInteger
[ 2] static ZERO : BigInteger
...etc...

Use of 'source' couldn't be simpler:
user= (source filter)
(defn filter
  Returns a lazy seq of the items in coll for which
  (pred item) returns true. pred must be free of side-effects.
  [pred coll]
(when (seq coll)
  (if (pred (first coll))
(lazy-cons (first coll) (filter pred (rest coll)))
(recur pred (rest coll)
nil

user= (source clojure.zip/node)
(defn node
  Returns the node at loc
  [loc] (loc 0))
nil

--Chouser

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



Re: My Clojure Emacs Setup (I'll show mine if you show yours)

2008-12-08 Thread Kyle R. Burton

I was wondering, since Emacs knows the file name (or at least the
buffer name) and line number it's sending a form from, and Clojure
represents that as meta-data (I think), could C-x C-e send that along
somehow wrapped in a form that sets these particular values for the
form that was shipped over?  Some kind of equivalent to #line and
#file (form C/C++/Perl)?

Is that possible?

Kyle

On Sun, Dec 7, 2008 at 12:07 AM, Bill Clementson [EMAIL PROTECTED] wrote:

 On Fri, Dec 5, 2008 at 5:23 PM, Mon Key [EMAIL PROTECTED] wrote:

 Nice blog entry :)

 Thanks! :)

 My setup tends to mirror yours esp. as I've culled most of it from
 your blog over the years...
 Most of my startup scripts are modified versions of those you've
 shared elsewhere.

 Glad you've found my posts useful.

 - Bill

 




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



Re: My Clojure Emacs Setup (I'll show mine if you show yours)

2008-12-06 Thread Bill Clementson

On Fri, Dec 5, 2008 at 5:23 PM, Mon Key [EMAIL PROTECTED] wrote:

 Nice blog entry :)

Thanks! :)

 My setup tends to mirror yours esp. as I've culled most of it from
 your blog over the years...
 Most of my startup scripts are modified versions of those you've
 shared elsewhere.

Glad you've found my posts useful.

- Bill

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



Re: My Clojure Emacs Setup (I'll show mine if you show yours)

2008-12-05 Thread Mon Key

Nice blog entry :)

My setup tends to mirror yours esp. as I've culled most of it from
your blog over the years...
Most of my startup scripts are modified versions of those you've
shared elsewhere.

I don't segment it out quite so much as it makes for transporting
directory trees difficult, and my directory structure is less UML more
ASCII...

I'm launching Clojure as the default lisp now so it's M-x Slime

Running W32 at work and OpenSuse at home I try to mirror everything as
much as possible beneath my user directory which makes transporting
configs fairly straight forward.  (I set EmacsW32 to convert
everything to UNIX style as much as possible - can't imagine working
the other direction).  I run the same color theme (ld-dark) on both
machines which keeps the transition transparent and ld-dark looks GOOD
at the REPL (to my eyes)

We differ on the build script.  It seems a waste of bandwidth to go
quite so scorched earth on the svn builds.
I glommed a modified setup that from a discussion here:

I use
;;; *Nix structure
/home/USERNAME/clojure/clojure-mode  clojure-mode for Emacs
/home/USERNAME/clojure/swank-clojure  swank for Emacs Slime
/home/USERNAME/clojure/clojure-svn/trunk  Trunk created on svn co
/home/USERNAME/clojure/clojure-contrib/trunk  Trunk created on
svn co
/home/USERNAME/clojure/Pragmatic-Programming-book/code  example
code from book
/home/USERNAME/local-emacs/slime  Slime for Emacs

;;; Windows Config
  c:\Documents and Settings\USERNAME\My Documents\clojure
which contains the following files and folders
-
|
--- slime    emacs slime direictory .el files in here
|
--- clojure  clojure.jar will be in ./trunk/clojure.jar
|
--- clojure-contrib  clojure-contrib.jar is in here
|
--- clojure-mode clojure-mode emacs .el files in here
|
--- swank-clojure    swank.jar is in here
|
--- launcher
|
--- launch-clojure.bat  script to start clojure (swank-
clojure-binary)
|
---Pragmatic-closure Code from Pragmatic Book - Programming
Closure
   |
   ---Pragmatict Programming Code

;;; I use thes for cleaning up and documenting my notes while i learn
clojure:
(defun comment-divider ()
(interactive)
(insert
;;; ==))

(global-set-key \C-c\C-di 'comment-divider)

;;; ==
(defun user-evald ()
useful for inserting the users evaluated list  at ^ for notes  and
repasting into a new REPL e.g.
user (+ 1 2)
;;; = 3 
(interactive)
(insert
;;; = ))

(global-set-key \C-c\M-; 'user-evald)


On Dec 5, 5:07 pm, bc [EMAIL PROTECTED] wrote:
 My setup is here:http://bc.tech.coop/blog/081205.html

 What does your Clojure Emacs setup look like?

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