Konrad Hinsen wrote:
> On Mar 12, 2009, at 10:59, Jeff Rose wrote:
>
>>> My main conclusion is that Clojure's system is a lot more flexible
>>> but also a lot more fragile. Any function can modify data of any
>>> "type" (as defined by metadata), even without being aware of this.
>> Modifying type
On Mar 12, 2009, at 10:59, Jeff Rose wrote:
>> My main conclusion is that Clojure's system is a lot more flexible
>> but also a lot more fragile. Any function can modify data of any
>> "type" (as defined by metadata), even without being aware of this.
>
> Modifying type tags without being aware o
Konrad Hinsen wrote:
> On 11.03.2009, at 23:34, Chouser wrote:
>
>> Interacting directly with a class dict feels a little dirty, because
>> you could be circumventing the API provided by the class methods,
>> making it easy to get the object into a bad state. Clojure's maps
>> being immutable re
On 11.03.2009, at 23:34, Chouser wrote:
> Interacting directly with a class dict feels a little dirty, because
> you could be circumventing the API provided by the class methods,
> making it easy to get the object into a bad state. Clojure's maps
> being immutable reduces the amount of trouble y
On Wed, Mar 11, 2009 at 5:34 PM, Chouser wrote:
[...]
>
> Defining a instance method for a Python class allows you to connect
> some code to your data, which internally uses a type pointer from the
> instance to the class. In Clojure you can put functions directly in
> the metadata (as clojure.z
On Wed, Mar 11, 2009 at 1:54 PM, Cosmin Stejerean wrote:
>
> IMHO a big reason Python programmers don't typically treat objects like is
> maps/dictionaries is that the set of things found in the map (dictionary)
> for that object (__dict__) are just a small subset of the interesting
> attributes
On Wed, Mar 11, 2009 at 12:00 PM, Konrad Hinsen
wrote:
>
> On Mar 8, 2009, at 18:53, Rich Hickey wrote:
>
> > I know people usually think of collections when they see vector/map/
> > set, and they think classes and types define something else. However,
> > the vast majority of class and type insta
On Mar 8, 2009, at 18:53, Rich Hickey wrote:
> I know people usually think of collections when they see vector/map/
> set, and they think classes and types define something else. However,
> the vast majority of class and type instances in various languages are
> actually maps, and what the class/
On Mar 9, 7:46 am, Rich Hickey wrote:
> On Mar 9, 2:19 am, Mark Engelberg wrote:
>
>
>
>
>
> > On Sun, Mar 8, 2009 at 10:44 PM, mikel wrote:
> > > Clojure doesn't have to provide these facilities (though I wouldn't
> > > mind if it did); it just needs to stay out of my way when I decide I
> >
On Mar 9, 2:43 am, mikel wrote:
> On Mar 9, 1:19 am, Mark Engelberg wrote:
>
> > On Sun, Mar 8, 2009 at 10:44 PM, mikel wrote:
> > > Clojure doesn't have to provide these facilities (though I wouldn't
> > > mind if it did); it just needs to stay out of my way when I decide I
> > > need to add
On Mar 9, 2:19 am, Mark Engelberg wrote:
> On Sun, Mar 8, 2009 at 10:44 PM, mikel wrote:
> > Clojure doesn't have to provide these facilities (though I wouldn't
> > mind if it did); it just needs to stay out of my way when I decide I
> > need to add them.
>
> Yeah, as much as I like maps, I fe
On Mar 8, 7:59 pm, Brian Carper wrote:
> On Mar 8, 10:53 am, Rich Hickey wrote:>
>
> > In looking at some of the libraries, I am a bit concerned that maps
> > are not being used when the logical entity is in fact a map.
>
> One time I find myself abusing vectors where maps would be better is
>
On Sun, Mar 8, 2009 at 9:59 PM, Brian Carper wrote:
>
> On Mar 8, 10:53 am, Rich Hickey wrote:>
>> In looking at some of the libraries, I am a bit concerned that maps
>> are not being used when the logical entity is in fact a map.
>
> One time I find myself abusing vectors where maps would be be
On Mar 9, 1:19 am, Mark Engelberg wrote:
> On Sun, Mar 8, 2009 at 10:44 PM, mikel wrote:
> > Clojure doesn't have to provide these facilities (though I wouldn't
> > mind if it did); it just needs to stay out of my way when I decide I
> > need to add them.
>
> Yeah, as much as I like maps, I fe
On Sun, Mar 8, 2009 at 10:44 PM, mikel wrote:
> Clojure doesn't have to provide these facilities (though I wouldn't
> mind if it did); it just needs to stay out of my way when I decide I
> need to add them.
Yeah, as much as I like maps, I feel like there are several common
uses cases for maps th
On Mar 8, 12:53 pm, Rich Hickey wrote:
> Recently it was said in a thread:
>
> "You can do a lot of that in Clojure, too, but, unless I'm mistaken,
> there are some arbitrary limits as things stand right now. ... you can
> have any kind of structure you want, as long as it's a map, set, or
> s
On Mar 8, 2009, at 9:38 PM, Rich Hickey wrote:
Do you have a case where the map-unpacking dominates the I/O time? Or
is this just a speculative optimization?
I was talking about the distinction between sending N value sets
across the JDBC interface in one call vs. in N calls. Unpacking maps
On Mar 8, 10:10 pm, "Stephen C. Gilardi" wrote:
> On Mar 8, 2009, at 9:13 PM, Shawn Hoover wrote:
>
> > Close... you can assoc new keys into a struct instance, but you
> > can't dissoc any of the basis keys.
>
> That's right.
>
> Given:
> user=> (defstruct foo :a :b)
> #'user/fo
On Mar 8, 2009, at 9:13 PM, Shawn Hoover wrote:
Close... you can assoc new keys into a struct instance, but you
can't dissoc any of the basis keys.
That's right.
Given:
user=> (defstruct foo :a :b)
#'user/foo
user=> (def t (struct foo 3))
#'user/t
dissoc of
On Mar 8, 10:53 am, Rich Hickey wrote:>
> In looking at some of the libraries, I am a bit concerned that maps
> are not being used when the logical entity is in fact a map.
One time I find myself abusing vectors where maps would be better is
in a situation where I have to retrieve key/value pair
On Mar 8, 9:05 pm, "Stephen C. Gilardi" wrote:
> On Mar 8, 2009, at 1:53 PM, Rich Hickey wrote:
>
> > First up is contrib.sql, where insert-rows and insert-values both take
> > a vector of column names followed by vectors of unlabeled values that
> > must be in the same order as the correspondi
On Sun, Mar 8, 2009 at 6:13 PM, Dan wrote:
>
> > I'm pretty sure structs are only appropriate for when you need to eek
> > the absolute last iota of performance out of a collection, in which case
> > they can provide greater speed than maps. But since the list of keys is
> > fixed, it means it's
On Mar 8, 2009, at 1:53 PM, Rich Hickey wrote:
First up is contrib.sql, where insert-rows and insert-values both take
a vector of column names followed by vectors of unlabeled values that
must be in the same order as the corresponding columns. I would hope
never to have such fragile things as t
I'm kind of a newb to these parts, but I disagree somewhat with Phil
that structmaps are only useful as a performance optimization.
It also seems to me that because they make it convenient to create
positional constructors for map structures, they make life much easier
to concisely build data str
> I'm pretty sure structs are only appropriate for when you need to eek
> the absolute last iota of performance out of a collection, in which case
> they can provide greater speed than maps. But since the list of keys is
> fixed, it means it's more effort to add or rename a key than it is with
> a
Dan writes:
>> I guess I want to advocate - don't merely replicate the things with
>> which you are familiar. Try to do things in the Clojure way. If your
>> logical structure is a mapping of names to values, please use a map.
>
> I tend to replace every instance of creating classes with creatin
Structs are maps with shared keys and positional constructors as Rich
mentions in the original post. I think Rich is saying that maps should
indeed "be abused" ;) By building all "higher level" structures on top of
them, consumers are guaranteed not only your custom functionality, but all
the func
> I guess I want to advocate - don't merely replicate the things with
> which you are familiar. Try to do things in the Clojure way. If your
> logical structure is a mapping of names to values, please use a map.
I tend to replace every instance of creating classes with creating
structs which, if
On Mar 8, 1:53 pm, Rich Hickey wrote:
> I really appreciate the work everyone is doing, just trying to
> maintain 'everything works with everything' with a nudge towards more
> consistent use of maps. Don't build your API on an island.
And a good nudge it is! This reminds me of Steve Yegge's ar
29 matches
Mail list logo