Timothy, I'm definitely dancing on the leaves instead of the twigs. Or as you said, I'm far out in the weeds. As for the problems I've had, it is because I often change abstractions which have only minor impact on the code. Classically, I'll redefine the meaning of a value and need to make only one or two changes and get a major change in how a program works. Which is why I hate mixing comments in the code--the comments change a lot faster than the code for me.
The source of my divergence is my own mental processes. I do not visualize. Mostly I do not think using words. And I am a rabid first-principals thinker. So I am constantly re-conceptualizing. I've gotten a lot of feedback. Very helpful. I really need to go quiet for a bit and digest all this. Thanks! On Tue, Nov 24, 2015 at 9:46 AM, Timothy Baldridge <[email protected]> wrote: > So let's back up a bit and take a look at your assumptions. In your > previous post you stated ", I kept thinking about why I am avoiding > protocols. In general, I very much like having abstractions. But I find > that even small abstractions tend to complect what with how." > > I would love to see an example of this in code. > > I tend to agree with some other people here, I think you're so far out in > the weeds with this approach that you haven't realized that one of your > starting assumptions could be incorrect. You state that protocols and > multimethods complicate refactoring, can you show us an example? > > Timothy > > > > On Tue, Nov 24, 2015 at 7:37 AM, William la Forge <[email protected]> > wrote: > >> So lets look at some artifacts then. I think we need an interface that >> all composites implement: >> >> (definterface Composite >> (compositeMap [])) >> >> The function composite-map returns the map which holds the aggregated >> functions and data. >> >> Now lets look at a sample function, blip: >> >> (def blip [^Composite this x y z] ((:blip (.compositeMap this)) this x y >> z)) >> >> and a protocol that includes blip: >> >> (defprotocol gran >> (blip ^Composite this x y z)) >> >> Next we define a type which will hold an aggregate that includes an >> implementation of blip: >> >> (deftype wackel [my-map] >> Composite >> (defn compositeMap [_] my-map)) >> >> and a function to create an instance of that type: >> >> (defn new-wackel [this opts] (assoc opts :blip (fn [this x y z] (+ x y >> z))) >> >> Finally, we can extend our type with the protocol: >> >> (extend wackel >> gran >> {:blip blip}) >> >> I find this uncomfortable. In Rich's terms this is simple but hard. To be >> expected, as it is a major decomplection. But it will take me a while to >> get comfortable with this. :-( >> >> --b >> >> >> >> -- >> You received this message because you are subscribed to the Google >> Groups "Clojure" group. >> To post to this group, send email to [email protected] >> Note that posts from new members are moderated - please be patient with >> your first post. >> To unsubscribe from this group, send email to >> [email protected] >> For more options, visit this group at >> http://groups.google.com/group/clojure?hl=en >> --- >> You received this message because you are subscribed to the Google Groups >> "Clojure" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > “One of the main causes of the fall of the Roman Empire was that–lacking > zero–they had no way to indicate successful termination of their C > programs.” > (Robert Firth) > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to [email protected] > Note that posts from new members are moderated - please be patient with > your first post. > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en > --- > You received this message because you are subscribed to a topic in the > Google Groups "Clojure" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/clojure/7Q7QvlSUGL4/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to [email protected] Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
