On Sep 23, 3:02 pm, F Lengyel wrote:
> On Sep 23, 2:20 am, Kevin Livingston
>
> wrote:
> > what's the actual use case where you want this?
> > it seems pretty weird just on it's own. it may in practice be more
> > clever than other solutions, but that's not clear yet. if you just
> > want a uni
On Sep 23, 2:20 am, Kevin Livingston
wrote:
> what's the actual use case where you want this?
> it seems pretty weird just on it's own. it may in practice be more
> clever than other solutions, but that's not clear yet. if you just
> want a unique symbol there's (gensym)
For the sake of illus
Hi,
is there any particular reason not to use a Set instead of a vector? It
solves the issue of distinct values. Or am I missing something?
Regards,
Stefan
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to cloju
On Sep 23, 2:18 am, Andy Fingerhut wrote:
> To be very precise, (conj v new-elem) is O(log n) in time and space, but it
> is "constant-ish" because the base of the logarithm is something like 32,
> rather than something like 2, so the constant factor multiplying the log n
> is typically pretty s
what's the actual use case where you want this?
it seems pretty weird just on it's own. it may in practice be more
clever than other solutions, but that's not clear yet. if you just
want a unique symbol there's (gensym)
regarding vectors, I found this a helpful read a while back, it's a
few yea
To be very precise, (conj v new-elem) is O(log n) in time and space, but it
is "constant-ish" because the base of the logarithm is something like 32,
rather than something like 2, so the constant factor multiplying the log n
is typically pretty small.
Also, there is no difference in Clojure's beha
On Sep 23, 1:39 am, Nathan Sorenson wrote:
> Just to clarify, you want to conj a vector to itself? i.e. [1 2 3 4] --> [1
> 2 3 4 [1 2 3 4]] I'm curious what the application of this is.
>
> Regarding the overhead of conj-ing to a vector: Clojure's data structures
> make use of structural sharing s
Just to clarify, you want to conj a vector to itself? i.e. [1 2 3 4] --> [1
2 3 4 [1 2 3 4]] I'm curious what the application of this is.
Regarding the overhead of conj-ing to a vector: Clojure's data structures
make use of structural sharing so conjoining an element to the end of a
vector won'
Suppose I have a vector v. I would like to add a new element to v
distinct
from all of the elements of v, with the constraint that I assume
nothing about v
other than it is a vector. (There are cases where it is useful to do
this
with some algorithms involving reduce, for example.) One way to do