*foo*

2012-10-09 Thread Brian Craft
I know I saw an explanation of this on some obscure page, but I can't find it now. What's up with the symbols with stars at front & end? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Not

(identical? "foo" "foo") evaluates to true

2011-02-15 Thread C. Arel
Hi all, I am watching the data structure videos and there it evaluates to false. Does this mean that only one object is created now? (Clojure update on String objects?) Kind Regards, Can -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this

Re: (identical? "foo" "foo") evaluates to true

2011-02-15 Thread B Smith-Mannschott
On Tue, Feb 15, 2011 at 11:46, C. Arel wrote: > Hi all, > I am watching the data structure videos and there it evaluates to > false. > Does this mean that only one object is created now? (Clojure update on > String objects?) I think this is a distinction without a difference since Strings are imm

Re: (identical? "foo" "foo") evaluates to true

2011-02-15 Thread Armando Blancas
For compilation and evaluation, yes. But not strings created at rumtime like: (def foo (str \f \o \o)) http://groups.google.com/group/clojure/browse_thread/thread/e43af17a0424b1cd On Feb 15, 2:46 am, "C. Arel" wrote: > Hi all, > I am watching the data structure videos and there

Re: (identical? "foo" "foo") evaluates to true

2011-02-15 Thread Stuart Sierra
Since about 1.1, I think, the Clojure compiler calls String.intern() on String literals. So yes, they are the same object. -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

Re: (identical? "foo" "foo") evaluates to true

2011-02-16 Thread C. Arel
Thank you all, It has to be the same object otherwise it makes no sense. Anyways that is good news since this means that Clojure has a little support built in so you don't create unneccessary objects. /Can Arel On 16 Feb, 00:27, Stuart Sierra wrote: > Since about 1.1, I think, the Clojure compil

Re: (identical? "foo" "foo") evaluates to true

2011-02-17 Thread Matthew Boston
I think I recall something in a CS class about how String is (or possibly is) implemented. Consider the following: 1) Each character of the alphabet, number, symbol etc. is assigned a memory location. 0x00, 0x01, 0x02, etc. etc. 2) A String has an internal representation as a char[]. So, String

Re: (identical? "foo" "foo") evaluates to true

2011-02-17 Thread Meikel Brandmeyer
Hi, On 17 Feb., 06:52, Matthew Boston wrote: > Again, this will have the same "path" of internal memory addresses. > Therefore (identical? "test" "test") is the same path of memory > addresses and is identical?. This is the = way. identical? means you really have the same array. Not only the sa

Re: *foo*

2012-10-09 Thread Grant Rettke
On Tue, Oct 9, 2012 at 12:54 PM, Brian Craft wrote: > I know I saw an explanation of this on some obscure page, but I can't find > it now. What's up with the symbols with stars at front & end? http://mumble.net/~campbell/scheme/style.txt -- You received this message because you are subscribed t

Re: *foo*

2012-10-09 Thread Grant Rettke
Gosh I thought it was in there... maybe it is not. Sorry. On Tue, Oct 9, 2012 at 12:55 PM, Grant Rettke wrote: > On Tue, Oct 9, 2012 at 12:54 PM, Brian Craft wrote: >> I know I saw an explanation of this on some obscure page, but I can't find >> it now. What's up with the symbols with stars at f

Re: *foo*

2012-10-09 Thread Tassilo Horn
Brian Craft writes: > I know I saw an explanation of this on some obscure page, but I can't > find it now. What's up with the symbols with stars at front & end? It's a convention that dynamic vars have "hearmuffs". (def ^:dynamic *foo*) Not everyone uses i

Re: *foo*

2012-10-09 Thread Mark Rathwell
It's in there, search Asterisks: Variants, Internal Routines, Mutable Globals On Tue, Oct 9, 2012 at 1:58 PM, Grant Rettke wrote: > Gosh I thought it was in there... maybe it is not. Sorry. > > On Tue, Oct 9, 2012 at 12:55 PM, Grant Rettke wrote: >> On Tue, Oct 9, 2012 at 12:54 PM, Brian Craft

Re: *foo*

2012-10-09 Thread Softaddicts
I would think that since we now live in an era were emphasis is put on neutral wording that *foo* is an accepted replacement for fubar which does not need any special markers to be understood by everyone :) Luc P. > I know I saw an explanation of this on some obscure page, but I can

Re: *foo*

2012-10-09 Thread Tamreen Khan
Asterisks are valid characters for names, just like alphanumeric characters, dashes, question marks, etc. According to Practical Clojure (http://books.google.com/books?id=4QacPa1vwMUC&pg=PA24&lpg=PA24&dq=clojure+star+character&source=bl&ots=2yDJkpf6ni&sig=2bV8rr5qpn-ev5Y50MW9XpE5fKA&hl=en&sa=X&ei=

Re: *foo*

2012-10-09 Thread Mark Rathwell
> It's in there, search Asterisks: Variants, Internal Routines, Mutable Globals Should have noted that's not how it is used in Clojure though On Tue, Oct 9, 2012 at 2:00 PM, Mark Rathwell wrote: > It's in there, search Asterisks: Variants, Internal Routines, Mutable Globals > > On Tue, Oct 9, 20

Why does (.foo (new Bar)) use a different method invocation mechanism than (def bar (new Bar)) (.foo bar)?

2011-01-16 Thread Robert Campbell
I've been trying to understand exactly how these two statements are evaluated by tracing execution through Compiler.java, Reflector.java, etc of tag 1.2.0. The second form - (.foo bar), expanded to (. bar foo) - eventually calls Reflector.invokeNoArgInstanceMember. The first form - (.foo

Re: Why does (.foo (new Bar)) use a different method invocation mechanism than (def bar (new Bar)) (.foo bar)?

2011-01-16 Thread Rasmus Svensson
2011/1/16 Robert Campbell : > The second form - (.foo bar), expanded to (. bar foo) - eventually > calls Reflector.invokeNoArgInstanceMember. For that form, the clojure compiler cannot infer the type of bar, and does not know which exact method (class + type signature) .foo represents.

Re: Why does (.foo (new Bar)) use a different method invocation mechanism than (def bar (new Bar)) (.foo bar)?

2011-01-16 Thread Robert Campbell
Thank you for the explanation Rasmus. I tried (.foo ^Bar bar) and it behaved exactly like (.foo (new Bar)) as you suggested. So method invocation via reflection works, while invokevirtual does not. As a sanity check I compared the bytecode of an AOT'd (working) invocation of a method compile

somehow (quote foo) came back from the REPL

2009-02-02 Thread Terrence Brannon
I was fooling around in the REPL and from the looks of the transcript, I typed the very same thing, yet in one case the REPL returned (quote foo) and in the other case it returned foo. Transcript follows: user=> \newline \newline user=> \c \c user=> nil nil user=> false false user

ANN: print-foo - a library of print debugging macros

2013-03-27 Thread Alex Baranosky
print-foo is a small library useful when debugging code, or at the REPL when writing your code. https://github.com/AlexBaranosky/print-foo It is a collection of macros that mimic basic clojure macros like defn, let, or ->, but which prints the value of the code at each point in

(in-ns 'foo) support for clj buffers in slime.

2008-10-20 Thread Luke Hope
Hi all, Adding the below to your .emacs will make slime change packages correctly according to (in-ns 'foo). All I did was alter slime-search-buffer-package in slime.el to create slime-search-buffer-package-clojure. The standard common-lisp patterns are still valid. Something like this

Re: somehow (quote foo) came back from the REPL

2009-02-02 Thread Dan Larkin
On Feb 2, 2009, at 8:32 PM, Terrence Brannon wrote: > > I was fooling around in the REPL and from the looks of the transcript, > I typed the very same thing, yet in one case the REPL returned (quote > foo) and in the other case it returned foo. > > Transcript follows: &

Re: somehow (quote foo) came back from the REPL

2009-02-02 Thread Michael Wood
On Tue, Feb 3, 2009 at 5:07 AM, Dan Larkin wrote: > > > On Feb 2, 2009, at 8:32 PM, Terrence Brannon wrote: > >> >> I was fooling around in the REPL and from the looks of the transcript, >> I typed the very same thing, yet in one case the REPL returned (quote &g

Re: ANN: print-foo - a library of print debugging macros

2013-10-27 Thread Alex Baranosky
t-> 5 (* 6) (* 2)) (print.foo/print-and-return '4 " " 4))) As of now the latest version is 0.4.2. https://github.com/AlexBaranosky/print-foo https://clojars.org/print-foo Best Alex On Thu, Mar 28, 2013 at 12:13 PM, Alex Baranosky < alexander.barano...@gmail.com> wrote:

Re: ANN: print-foo - a library of print debugging macros

2013-03-28 Thread Jim - FooBar();
h is the one I mostly use but I can imagine it shouldn't be too hard to do the same on the threading macros, cond etc. Also if I face any problems there is always your code to guide me... Jim On 28/03/13 05:42, Alex Baranosky wrote: print-foo is a small library useful when debugging code

Re: ANN: print-foo - a library of print debugging macros

2013-03-28 Thread Cedric Greevey
Why not generalize further then? Have a macro def-foo-let (actual name) that takes a name and an operator (function or macro), so that (defn print-out [x] (println x) x) (def-foo-let print-let print-out) will generate a print-let that prints each thing as it's computed, and (def-fo

Re: ANN: print-foo - a library of print debugging macros

2013-03-28 Thread adrians
Looks useful, but I'm getting this: user=> (use 'print-foo) FileNotFoundException Could not locate print_foo__init.class or print_foo.clj on classpath: clojure.lang.RT.load (RT.java:443) using lein 2.1.1 Cheers On Thursday, March 28, 2013 1:42:42 AM UTC-4, Alex Baranosky wro

Re: ANN: print-foo - a library of print debugging macros

2013-03-28 Thread Alex Baranosky
Let me fix the README, the library should be required like this (:require [print.foo :refer :all]) On Thu, Mar 28, 2013 at 11:22 AM, adrians wrote: > Looks useful, but I'm getting this: > > user=> (use 'print-foo) > FileNotFoundException Could not locate print_foo__init

Re: ANN: print-foo - a library of print debugging macros

2013-03-28 Thread Alex Baranosky
this (:require > [print.foo :refer :all]) > > > On Thu, Mar 28, 2013 at 11:22 AM, adrians wrote: > >> Looks useful, but I'm getting this: >> >> user=> (use 'print-foo) >> FileNotFoundException Could not locate print_foo__init.class or >> print_foo

Re: ANN: print-foo - a library of print debugging macros

2013-03-28 Thread Jim - FooBar();
On 28/03/13 18:39, Alex Baranosky wrote: Jim, I'm interested in that idea definitely, but perhaps we should just create another open source project for time.foo? Ok cool, I'll do that over the weekend and poke you sometime next week to have a look...also, have you deliberately left out prin

Re: ANN: print-foo - a library of print debugging macros

2013-03-28 Thread adrians
Alex, print-foo *is* the correct artifact name, no? It seemed to be pulled down fine by pomegranate. On Thursday, March 28, 2013 2:35:31 PM UTC-4, Alex Baranosky wrote: > > Let me fix the README, the library should be required like this (:require > [print.foo :refer :all]) >

Re: ANN: print-foo - a library of print debugging macros

2013-03-28 Thread Alex Baranosky
adrians, https://clojars.org/print-foo I've got to deploy it with proper signing. On Thu, Mar 28, 2013 at 11:59 AM, adrians wrote: > Alex, print-foo *is* the correct artifact name, no? It seemed to be > pulled down fine by pomegranate. > > > On Thursday, March 28, 2013 2:

Re: ANN: print-foo - a library of print debugging macros

2013-03-28 Thread Alex Baranosky
Jim, No reason I left out loop/recur. I just didn't get around to it. Pull requests accepted. On Thu, Mar 28, 2013 at 12:07 PM, Alex Baranosky < alexander.barano...@gmail.com> wrote: > adrians, > > https://clojars.org/print-foo > > I've got to deploy it with pr

how can I call java method that requires Foo[] as argument?

2011-02-20 Thread B Smith-Mannschott
Hi all! My new goal in life is to learn my way around the SVNKit API, using Clojure. It didn't take me long to reach the first stumbling block: Here's the situation: The class SVNCommitClient [1] defines two overloads of doMkDir. I'm trying to call the two argument version: SVNCommitInfo do

Bug? (vary-meta (promise) assoc :foo 1) hangs in Clojure 1.2

2011-05-10 Thread Ken Wesson
(vary-meta (promise) assoc :foo 1) hangs in Clojure 1.2. I suspect that vary-meta is somehow triggering an attempt to deref the promise. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@google

Re: how can I call java method that requires Foo[] as argument?

2011-02-20 Thread Daniel Solano Gomez
On Sun Feb 20 19:13 2011, B Smith-Mannschott wrote: > The class SVNCommitClient [1] defines two overloads of doMkDir. I'm > trying to call the two argument version: > > SVNCommitInfo doMkDir(SVNURL[] urls, String commitMessage) > > [1] http://svnkit.com/javadoc/org/tmatesoft/svn/core/wc/SVNCo

Re: how can I call java method that requires Foo[] as argument?

2011-02-20 Thread B Smith-Mannschott
ort [org.tmatesoft.svn.core SVNURL] [org.tmatesoft.svn.core.wc SVNClientManager])) (.. (SVNClientManager/newInstance) (getCommitClient) (doMkdir (new-array SVNURL [(SVNURL/parseURIEncoded "svn://meh/scratch/foo")]) "foo")) new-array i

Re: how can I call java method that requires Foo[] as argument?

2011-02-20 Thread B Smith-Mannschott
On Sun, Feb 20, 2011 at 19:24, Daniel Solano Gomez wrote: > On Sun Feb 20 19:13 2011, B Smith-Mannschott wrote: >> The class SVNCommitClient [1] defines two overloads of doMkDir. I'm >> trying to call the two argument version: >> >>     SVNCommitInfo doMkDir(SVNURL[] urls, String commitMessage) >>

Re: how can I call java method that requires Foo[] as argument?

2011-02-20 Thread B Smith-Mannschott
t;   [org.tmatesoft.svn.core.wc SVNClientManager])) > > (.. (SVNClientManager/newInstance) >    (getCommitClient) >    (doMkdir (new-array SVNURL >                [(SVNURL/parseURIEncoded "svn://meh/scratch/foo")]) >             "foo")) > > new-array is

Re: Bug? (vary-meta (promise) assoc :foo 1) hangs in Clojure 1.2

2011-05-10 Thread Alan
(promise) hangs in 1.2, if you try to print it from the repl. There's a ticket somewhere for better handling of non-delivered promises. On May 10, 5:01 pm, Ken Wesson wrote: > (vary-meta (promise) assoc :foo 1) hangs in Clojure 1.2. I suspect > that vary-meta is somehow triggering an

Re: Bug? (vary-meta (promise) assoc :foo 1) hangs in Clojure 1.2

2011-05-10 Thread Ken Wesson
On Tue, May 10, 2011 at 8:04 PM, Alan wrote: > (promise) hangs in 1.2, if you try to print it from the repl. There's > a ticket somewhere for better handling of non-delivered promises. Ah, damn. It should see if it's delivered or not and print # or similar in that case rather than try to print it

Re: Bug? (vary-meta (promise) assoc :foo 1) hangs in Clojure 1.2

2011-05-11 Thread Meikel Brandmeyer
Hi, Am 11.05.2011 um 03:00 schrieb Ken Wesson: > Anyway, maybe this will come in handy: Clojure 1.3 will support timeouts; however on the deref side, not on promise definition. It'll also handle the not-delivered issue. user=> (def p (promise)) #'user/p user=> (future (Thread/sleep 5000) (deli

Re: Bug? (vary-meta (promise) assoc :foo 1) hangs in Clojure 1.2

2011-05-11 Thread Stuart Halloway
On 1.3 master there is: clojure.core/deref ([ref] [ref timeout-ms timeout-val]) Also reader macro: @ref/@agent/@var/@atom/@delay/@future/@promise. Within a transaction, returns the in-transaction-value of ref, else returns the most-recently-committed value of ref. When applied to a var, age