On Sat, Feb 28, 2009 at 6:13 AM, Stephen C. Gilardi wrote:
>
> On Feb 27, 2009, at 10:59 PM, Joshua wrote:
>
>> Is the desired syntax to match the CL version?
>
> Following CL's lead by implementing a *read-eval* var as Stuart suggested
> looks like a good way to do this to me.
So, I suppose the
> I'm not sure which old-map you mean here. If you mean the old
> lazy-cons version, using your above macro, this will have too many
> lazy-seq calls.
Yeah, you're right ... I managed to confuse myself.
Off the top of my head I can't think of a nicer way to write lazier-
map than what you'v
On Fri, Feb 27, 2009 at 8:33 PM, Jason Wolfe wrote:
>
> If lazy-cons makes your life easier, I think you can still have
> something very much like it:
>
> (defmacro lazy-cons [x s]
> `(lazy-seq (cons ~x (lazy-seq ~s
As you pointed out, in most contexts, this will double the number of
lazy-s
Apologies for thread-hijackig but I thought I'd mention that one of the
problems I've had using Clojure under OSGi was fixed with a minor patch
(mentioned in my post at
http://www.talios.com/clojure_running_successfully_under_osgi.htm ) which
had to do with the assumption non jar:// classpath entri
If lazy-cons makes your life easier, I think you can still have
something very much like it:
(defmacro lazy-cons [x s]
`(lazy-seq (cons ~x (lazy-seq ~s
If you're interested in perf, you'd just have to write your code a bit
carefully to avoid double lazy-seq'ing the rests:
(defn map [f col
On Feb 27, 2009, at 10:59 PM, Joshua wrote:
Is the desired syntax to match the CL version?
Following CL's lead by implementing a *read-eval* var as Stuart
suggested looks like a good way to do this to me.
Should I create a separate reader for the read-only version or just
use an if state
I just finished porting my combinatorics code to the new lazy
constructs, and I discovered some subtleties to using lazy-seq that
were not at first apparent.
To begin with, consider the two versions of map:
The old way:
(defn map
([f coll]
(when (seq coll)
(lazy-cons (f (first coll)) (
I have started looking into Issue 34 and I have some questions.
Link:
http://code.google.com/p/clojure/issues/detail?id=34&colspec=ID%20Type%20Status%20Priority%20Reporter%20Owner%20Summary
Is the desired syntax to match the CL version?
Should I create a separate reader for the read-only version
I think it's simpler just to have a consistent syntax, personally.
Otherwise, why not python or haskell style syntax for the language? because
code is data. So now there's a special case where the data is backwards.
On Fri, Feb 27, 2009 at 1:49 PM, Meikel Brandmeyer wrote:
> Hi,
>
> Am 27.02.2
> Were you thinking of what's now called "next" and used to be called "rest"?
No.
>
> Why did you expect nil from rest in this case?
I expect:
(rest [1]) -> ()
(rest []) -> nil
Starting with the new lazier branch, we have a concept of an empty
sequence. So the rest of a singleton yields an em
You're right Rich,
We all have to agree on the means used to implement this in the Clojure
runtime.
Any code we throw right now has to be somewhat aligned with these
decisions.
The decision to hide the AtomicReference class was easy to take. It was
an unavoidable
obstacle. Any other issues from t
On Feb 27, 6:54 pm, Luc Prefontaine
wrote:
> Having the ability to redefine a function once for all instances is
> something we really want...
> and you need name spaces to be shared for that to happen.
> We take the approach of sharing everything that seems to worth it, then
> we will see
> wh
On Feb 27, 2009, at 8:27 PM, Mark Engelberg wrote:
Maybe it doesn't matter in practice, but does it seem odd to anyone
else that (rest ()) returns () rather than nil?
I think that's to be expected given the recent changes to how laziness
works in Clojure. It's consistent with these docs:
Maybe it doesn't matter in practice, but does it seem odd to anyone
else that (rest ()) returns () rather than nil?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email t
On Feb 27, 2009, at 7:29 PM, Mark Addleman wrote:
>
> On Feb 27, 7:17 am, Rich Hickey wrote:
>>
>>> Are namespaces & global set of namespaces "watchable" things ?
>>
>> No they are not.
>
> Is there a deep reason for this? I'm not familiar with this part of
> Clojure but, if the functionality
On Feb 27, 7:17 am, Rich Hickey wrote:
>
> > Are namespaces & global set of namespaces "watchable" things ?
>
> No they are not.
Is there a deep reason for this? I'm not familiar with this part of
Clojure but, if the functionality is possible, would you accept a
patch for this?
--~--~-~
It looks really nice. I have a question about those observers, though--
every time that a context-processing function is called, every
observer is called one by one, no matter what the context-processing
function was. This seems somewhat inefficient, more so than listeners
that listen to only cert
Having the ability to redefine a function once for all instances is
something we really want...
and you need name spaces to be shared for that to happen.
We take the approach of sharing everything that seems to worth it, then
we will see
what we might need to keep private to each JVM.
Sharing var
On Feb 25, 6:02 pm, "Stephen C. Gilardi" wrote:
>
> - When using waterfront on Mac OS X, it appears that the control
> characters intended to trigger menu selections (e.g. ^E) are being
> intercepted before they reach the menus. In the specific case of ^E,
> it is being interpreted by the t
As an aside, "gem install djspiewak-buildr" probably works again.
I've merged Assaf's fixes, and GitHub *claims* to be building things
correctly. So, I haven't tried it, but I can't think of a reason why
it wouldn't work.
Daniel
On Feb 27, 2:39 pm, Christian Vest Hansen
wrote:
> On Fri, Feb 27
> I'm not sure I understand. Are you referring to
> UIManager.getSystemLookAndFeelClassName() ?
> This is the L&F that Waterfront is using. If you don't get this L&F
> then perhaps the call to setLookAndFeel() fails on your machine. I'll
> add a piece of code to log the exception.
>
> -Itay
It al
Yeah, after sharing clojure.lang.Keyword.table I tried to share
clojure.lang.Namespace.namespaces, but ran into a problem because
Namespace uses an AtomicReference for its mappings and aliases
members. I thought that not sharing namespaces would be a problem (and
maybe it still is I don't have as
Paul Stadig writes:
> I've recently done some experimentation with Clojure and Terracotta.
> I've detailed my experience at:
>
> http://paul.stadig.name/2009/02/clojure-terracotta-yeah-baby.html
Very exciting; I'm looking forward to trying this out! Thanks for posting.
-Phil
--~--~-~-
We are trying to get Clojure shared over Terracotta, not just specific
things but the whole Clojure object space
(name spaces, root values, ) except stuff that needs to remain local
(streams, ).
We take an all or nothing approach here, we would to see many Clojure
instances work as a singl
It's a pretty common idiom in other languages for substring functions to
count from the end if given a negative index.
(substring "hello world!" 6 -1) ;; => "world"
I'd be glad if Clojure's "subs" function could work like this. Should I
create an issue and patch to implement it?
-Phil
--~--
> > The cells implementations I've seen posted to this list (in fact pretty
> > much all
> > cells reimplementations) haven't yet approached the sophistication of
> > kenny-cells.
>
> Agreed. And I wrote two of them. They're just toy implementations so
> far.
I'm still not sure how it should l
On Fri, Feb 27, 2009 at 6:47 PM, Daniel Spiewak wrote:
>
> Correction:
>
> git clone git://github.com:djspiewak/buildr.git
git clone git://github.com/djspiewak/buildr.git
Excellent. Got it installed.
>
> Daniel
>
> On Feb 27, 11:44 am, Daniel Spiewak wrote:
>> I was able to repeat the problem
I've recently done some experimentation with Clojure and Terracotta.
I've detailed my experience at:
http://paul.stadig.name/2009/02/clojure-terracotta-yeah-baby.html
and shared my code at:
http://github.com/pjstadig/terraclojure/tree/master/
I'm the first to admit that I'm not an expert in Te
>
> It's pretty useful for nested keywords:
>
> (:name (:profile (:user message)))
>
> (-> message :user :profile :name)
>
> - James
That is really cool. Once again the language and the community impress
me with how elegant the language is.
Allen
--~--~-~--~~~--
On Feb 27, 6:39 pm, "John D. Hume" wrote:
> As a Java/Ruby guy who is not used to reading inside out, I'm curious
> as to whether people who ARE accustomed to LISP find the -> macro
> distracting since it flops things around. Are there circumstances
> where you prefer it?
It's pretty useful for
Hi,
Am 27.02.2009 um 19:39 schrieb John D. Hume:
As a Java/Ruby guy who is not used to reading inside out, I'm curious
as to whether people who ARE accustomed to LISP find the -> macro
distracting since it flops things around. Are there circumstances
where you prefer it?
I have a Scheme backg
On Feb 27, 12:59 pm, Andy Chambers
wrote:
> The cells implementations I've seen posted to this list (in fact pretty much
> all
> cells reimplementations) haven't yet approached the sophistication of
> kenny-cells.
Agreed. And I wrote two of them. They're just toy implementations so
far.
-Stu
On Wed, Feb 25, 2009 at 4:11 PM, Jason Wolfe wrote:
> (you'll get use to reading inside-out quickly).
As a Java/Ruby guy who is not used to reading inside out, I'm curious
as to whether people who ARE accustomed to LISP find the -> macro
distracting since it flops things around. Are there circum
2009/2/27 Marko Kocić :
>
> Interesting approach, nice explained.
>
> Does anyone have similar example using one of the cells
> implementations?
> What would be pros/cons between this and cells approach?
The cells implementations I've seen posted to this list (in fact pretty much all
cells reimpl
Correction:
git clone git://github.com:djspiewak/buildr.git
Daniel
On Feb 27, 11:44 am, Daniel Spiewak wrote:
> I was able to repeat the problem. I suspect that the issue is the way
> in which GitHub is building its gems. I think Assaf (the lead dev for
> Buildr) has implemented a workarou
I was able to repeat the problem. I suspect that the issue is the way
in which GitHub is building its gems. I think Assaf (the lead dev for
Buildr) has implemented a workaround in some of the more recent
commits, but I haven't been able to merge with his master so I really
couldn't say.
For the
David Nolen writes:
> What about something like:
>
> (defn gt [str1 str2]
> (first (sort [str1 str2])))
>
> (gt "Zoe" "Bob") ; -> "Bob"
If nothing exists yet, defining <, >, <=, and >= in str-utils might work.
-Phil
--~--~-~--~~~---~--~~
You received this mes
Hi!
Am 27.02.2009 um 18:03 schrieb Phil Hagelberg:
> Agreed. Am curious as to what the idiomatic way to check to see if one
> string is alphabetically greater than another is though.
"compare" seems to do the right thing in most cases. You could define
shorthands if that's too much typing:
us
What about something like:
(defn gt [str1 str2]
(first (sort [str1 str2])))
(gt "Zoe" "Bob") ; -> "Bob"
On Fri, Feb 27, 2009 at 12:03 PM, Phil Hagelberg wrote:
>
> Christian Vest Hansen writes:
>
> >> Are you referring to using <, >, =, with objects that implement
> >> java.lang.Comparable?
Thanks for the responses - very helpful.
On Feb 27, 3:24 pm, Chouser wrote:
> On Fri, Feb 27, 2009 at 10:14 AM, James Reeves
>
> wrote:
>
> > Just to expand on Meikel's answer: when people upload files, it's
> > usually as an attachment to an existing thread. Reading though the
> > file list is
On Feb 27, 5:22 pm, Marko Kocić wrote:
> Nice work.
>
> I have a couple of (mostly cosmetic but important suggestions):
> - Set look and feel to NativeLookAndFeel
I'm not sure I understand. Are you referring to
UIManager.getSystemLookAndFeelClassName() ?
This is the L&F that Waterfront is usin
Christian Vest Hansen writes:
>> Are you referring to using <, >, =, with objects that implement
>> java.lang.Comparable?
>>
>> i.e. given x.compareTo(y) == -1
>> (< x y)
>> => true
>>
>> I would find that useful.
>
> I think having <, >, <=, >= be based on Comparable has been discussed before.
Thanks very much Itay,
I'm reading through your post very carefully. I sounds like it's the
answer to all my problems.
-Patrick
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group,
Never mind, I get it now.
Thanks,
Anand
On Feb 27, 4:32 pm, Anand Patil
wrote:
> Hi Rich,
>
> On Feb 27, 2:57 pm, Rich Hickey wrote:
>
> > I've added (back) synchronous watches (svn 1309+), which used to exist
> > for agents, now for all reference types.
>
> > (defn add-watch
>
> > "Experime
Hi Rich,
On Feb 27, 2:57 pm, Rich Hickey wrote:
> I've added (back) synchronous watches (svn 1309+), which used to exist
> for agents, now for all reference types.
>
> (defn add-watch
>
> "Experimental.
>
> Adds a watch function to an agent/atom/var/ref reference. The watch
> fn must be a
On Feb 26, 7:08 pm, CuppoJava wrote:
> Hello Ilya,
> Thanks for the workaround.
>
> I'm glad to hear you're working on a "surround with" feature. Some
> other parenthesis commands that I most commonly use is:
> 1) Delete next Sexp.
> 2) Splice Sexp. (Remove the parenthesis around the curren
On Fri, Feb 27, 2009 at 10:14 AM, James Reeves
wrote:
>
> Just to expand on Meikel's answer: when people upload files, it's
> usually as an attachment to an existing thread. Reading though the
> file list isn't a very good way of learning Clojure, as it's just a
> flat list of every file anyone h
Nice work.
I have a couple of (mostly cosmetic but important suggestions):
- Set look and feel to NativeLookAndFeel
- Allow user to increase application fonts, not just editor fonts.
Regards,
Marko Kocić
--~--~-~--~~~---~--~~
You received this message because you
On Feb 27, 10:13 am, Laurent PETIT wrote:
> Rich,
>
> I know I could search through clojure source code for this question (and
> that this question is not totally related to the current thread), but could
> you please tell me if there is a possibility to watch for additions/removals
> of vars t
Just to expand on Meikel's answer: when people upload files, it's
usually as an attachment to an existing thread. Reading though the
file list isn't a very good way of learning Clojure, as it's just a
flat list of every file anyone has ever uploaded to the group. Without
the context of the origina
Rich,
I know I could search through clojure source code for this question (and
that this question is not totally related to the current thread), but could
you please tell me if there is a possibility to watch for additions/removals
of vars to a namespace, and additions/removals of namespaces to th
I've added (back) synchronous watches (svn 1309+), which used to exist
for agents, now for all reference types.
(defn add-watch
"Experimental.
Adds a watch function to an agent/atom/var/ref reference. The watch
fn must be a fn of 4 args: a key, the reference, its old-state, its
new-stat
Interesting approach, nice explained.
Does anyone have similar example using one of the cells
implementations?
What would be pros/cons between this and cells approach?
Regards,
Marko Kocić
--~--~-~--~~~---~--~~
You received this message because you are subscribed
I've seen the term "skyhook" used to describe a very similar system. In any
event, it looks cool.
On Fri, Feb 27, 2009 at 5:24 AM, linh wrote:
>
> thanks, this will be very useful for me
>
> On 27 Feb, 09:05, Itay Maman wrote:
> > Some of the reaction for Waterfront was related to the Applicat
Revision 148 is available for download at
http://sourceforge.net/project/platformdownload.php?group_id=249246
It addresses some of the requests that were raised in this discussion:
* Changed default location of the divider
* Fixed the "command-key" issue on Macs.
* Java 1.5 compilance (prev. 1.6)
On 27.02.2009, at 14:46, Mark Volkmann wrote:
> Is it correct to say that each loaded function is represented by an
> AFn object in memory?
Each compiled function becomes a class that extends AFn. When the
function is created in the Clojure code, an object is generated from
this class. If yo
On Wed, Feb 25, 2009 at 12:18 AM, .Bill Smith wrote:
> The map alone is not sufficient to describe the object; you need the
> class too. That's true both for the bean and any of it's bean-typed
> properties, since a property might be typed with an interface or an
> abstract class for which there
Is it correct to say that each loaded function is represented by an
AFn object in memory?
Are macros represented in memory in the same way?
--
R. Mark Volkmann
Object Computing, Inc.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to th
On Fri, Feb 27, 2009 at 2:30 PM, Mark Volkmann
wrote:
>
> On Fri, Feb 27, 2009 at 4:34 AM, Michael Wood wrote:
[...]
>> Bindings created with binding can be assigned to, which provides a
>> means for nested contexts to communicate with code before it _in_ the call
>> stack.
[...]
>
> The word "b
On Feb 27, 2:50 am, Konrad Hinsen wrote:
> The attached patch to clojure.core fixes the printing problem for
> types that have no implementation of print-method. When such objects
> are printed or converted to strings, an infinite loop leads to a
> stack overflow. The reason is that the :defaul
On Fri, Feb 27, 2009 at 4:34 AM, Michael Wood wrote:
>
> On Fri, Feb 27, 2009 at 11:08 AM, timc wrote:
>>
>> On the page describing Vars, I cannot get the meaning of this sentence
>> (a typo has made it incomprehensible I think):
>>
>> "Bindings created with binding can be assigned to, which pro
On Fri, Feb 27, 2009 at 11:08 AM, timc wrote:
>
> On the page describing Vars, I cannot get the meaning of this sentence
> (a typo has made it incomprehensible I think):
>
> "Bindings created with binding can be assigned to, which provides a
> means for nested contexts to communicate with code be
thanks, this will be very useful for me
On 27 Feb, 09:05, Itay Maman wrote:
> Some of the reaction for Waterfront was related to the Application
> Context Pattern (ACP) - The pattern that allows most of Waterfront's
> code to be purely functional. I'll try to explain the basics in this
> post. L
On Fri, Feb 27, 2009 at 12:47 AM, Allen Rohner wrote:
>
>
>> I agree regarding concatenation as well, but I think the case for
>> comparison of non-numerics is still pretty strong.
>>
>> -Phil
>
> Are you referring to using <, >, =, with objects that implement
> java.lang.Comparable?
>
> i.e. giv
Hi,
Am 27.02.2009 um 10:41 schrieb timc:
OK - choosing files at random:
Is it at all obvious what these do?
app.clj
application-context-patter.clj
binary-structure.clj
bookmark-tut.clj
bsptree.clj
chlam-clean-clj
and so on...
I guess for almost all of these files there is a thread
in the g
OK - choosing files at random:
Is it at all obvious what these do?
app.clj
application-context-patter.clj
binary-structure.clj
bookmark-tut.clj
bsptree.clj
chlam-clean-clj
and so on...
On Feb 27, 9:20 am, Laurent PETIT wrote:
> What are you talking about ? It's really vague.
>
> It seems to m
Here's an example:
user> (def x)
#'user/x
user> (defn foo [] (set! x 10))
#'user/foo
user> (binding [x 1] [x (binding [x 2] [x (do (foo) x)]) x])
[1 [2 10] 1]
Foo passes information to the calling form by assigning to x, within
the innermost binding only.
It sounds like the quote should say "
What are you talking about ? It's really vague.
It seems to me that people in this list have always been kind to help people
discovering the language.
And if you turn it the other way around, maybe people are not always
explaining each line of code because they don't presuppose that readers will
m
Can I make a small plea for people who submit source code to PLEASE
insert some sort of explanation of what the code is about.
I know it's usual in programming circles to think that if someone
can't understand something it's because they are dumb - but really -
this is a terribly inefficient way
On the page describing Vars, I cannot get the meaning of this sentence
(a typo has made it incomprehensible I think):
"Bindings created with binding can be assigned to, which provides a
means for nested contexts to communicate with code before it the call
stack."
Thanks
--~--~-~--~~-
Hi,
Am 27.02.2009 um 08:20 schrieb Konrad Hinsen:
I have been trying in vain to get the namespace docstring of anything
with print-namespace-doc. It doesn't say what exactly it wants as an
argument (a symbol, a string, or a namespace object), but it calls
ns-name, which wants a symbol, so I g
Hi,
I just posted about the application context pattern. I believe it
addresses the issue you're describing.
-Itay
On Feb 27, 4:21 am, CuppoJava wrote:
> Hi,
> After having used Clojure for a few months now, I'm still having lots
> of trouble separating my mutable code from my immutable code.
Some of the reaction for Waterfront was related to the Application
Context Pattern (ACP) - The pattern that allows most of Waterfront's
code to be purely functional. I'll try to explain the basics in this
post. Let me start with the motivation: the reason why FP is at odds
with GUI code.
(Pure) F
73 matches
Mail list logo