Re: list* not returning a list

2013-01-04 Thread Michał Marczyk
Hey, I replied in the ticket with some comments. The main issue I see is that I'm used to the notion that IPersistentLists are things which are not lazy and which have next/rest parts which are themselves IPLs and this approach seems to cause that no longer to be the case. If it were not to be the

Re: list* not returning a list

2013-01-04 Thread Marek Šrank
I found CLJ-1060 [1] and added there a patch with Cons implementing IPersistentList and (apply list args) in one-argument case of list*. Marek [1] http://dev.clojure.org/jira/browse/CLJ-1060 On Wednesday, December 26, 2012 9:35:25 PM UTC+1, Marek Šrank wrote: > > function list* doesn't return

Re: list* not returning a list

2012-12-27 Thread Michał Marczyk
On 27 December 2012 18:52, Ben Wolfson wrote: > On Thu, Dec 27, 2012 at 9:08 AM, Michał Marczyk > wrote: >> On 27 December 2012 03:28, Tom Jack wrote: >>> It looks like the only thing missing to make Cons implement IPersistentList >>> is IPersistentStack. Why not implement it? >> >> IPersistentS

Re: list* not returning a list

2012-12-27 Thread Marek Šrank
Making Cons implement IPersistentList will solve all cases except when list* gets only one argument. This is problematic. The source looks like this: (defn list* "Creates a new list containing the items prepended to the rest, the last of which will be treated as a sequence." {:added "1.0"

Re: list* not returning a list

2012-12-27 Thread Ben Wolfson
On Thu, Dec 27, 2012 at 9:08 AM, Michał Marczyk wrote: > On 27 December 2012 03:28, Tom Jack wrote: >> It looks like the only thing missing to make Cons implement IPersistentList >> is IPersistentStack. Why not implement it? > > IPersistentStack extends IPersistentCollection, which includes > cou

Re: list* not returning a list

2012-12-27 Thread Michał Marczyk
On 27 December 2012 03:28, Tom Jack wrote: > It looks like the only thing missing to make Cons implement IPersistentList > is IPersistentStack. Why not implement it? IPersistentStack extends IPersistentCollection, which includes count(), so that's no go for Cons (the rest part might be a lazy seq

Re: list* not returning a list

2012-12-27 Thread Ben Wolfson
On Wed, Dec 26, 2012 at 6:28 PM, Tom Jack wrote: > A small bug in ClojureScript was related to this: > https://github.com/clojure/clojurescript/commit/88b36c177ebd1bb49dbd874a9d13652fd1de4027 > > It looks like the only thing missing to make Cons implement IPersistentList > is IPersistentStack. Why

Re: list* not returning a list

2012-12-26 Thread Tom Jack
A small bug in ClojureScript was related to this: https://github.com/clojure/clojurescript/commit/88b36c177ebd1bb49dbd874a9d13652fd1de4027 It looks like the only thing missing to make Cons implement IPersistentList is IPersistentStack. Why not implement it? On Wednesday, December 26, 2012 4:13:

Re: list* not returning a list

2012-12-26 Thread Ben Wolfson
On Wed, Dec 26, 2012 at 2:07 PM, Stephen Compall wrote: > On Wed, 2012-12-26 at 12:35 -0800, Marek Šrank wrote: >> ...however, its docstring says: "Creates a new list containing the items >> prepended to the rest, the last of which will be treated as a sequence." > > List is almost always colloqui

Re: list* not returning a list

2012-12-26 Thread Stephen Compall
On Wed, 2012-12-26 at 12:35 -0800, Marek Šrank wrote: > ...however, its docstring says: "Creates a new list containing the items > prepended to the rest, the last of which will be treated as a sequence." List is almost always colloquial, not literally IPersistentList. I would be in favor of elim

list* not returning a list

2012-12-26 Thread Marek Šrank
function list* doesn't return a list, because it uses 'cons' under the hood: (list? (list* 1 2 3 '())) ;=> false (class (list* 1 2 3 '())) ;=> clojure.lang.Cons ...however, its docstring says: "Creates a new list containing the items prepended to the rest, the last of which will be treated as a