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
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
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
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
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
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
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
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
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
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
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
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
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
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=
> 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
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
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.
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
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
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
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
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:
&
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
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:
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
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
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
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
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
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
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])
>
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:
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
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
(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
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
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
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)
>>
t; [org.tmatesoft.svn.core.wc SVNClientManager]))
>
> (.. (SVNClientManager/newInstance)
> (getCommitClient)
> (doMkdir (new-array SVNURL
> [(SVNURL/parseURIEncoded "svn://meh/scratch/foo")])
> "foo"))
>
> new-array is
(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
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
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
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
43 matches
Mail list logo