2010/6/3 Meikel Brandmeyer
> Hi,
>
> Am 03.06.2010 um 21:51 schrieb Laurent PETIT:
>
> >> (in-ns 'some.other.namespace)
> >>
> >> (let [orig-x some-x]
> >> (defn some-x
> >>[foo]
> >>(if (my-foo? foo)
> >> (do-stuff foo)
> >> (orig-x foo
> >
> > Sorry Meikel, but I'm having
2010/6/3 Stuart Halloway
> > May I add this policy concerning Clojure protocols (as well as the rule
> "one must only extend a protocol to a type if he owns either the type or the
> protocol. If one breaks the rule, one should be prepared to withdraw should
> the implementor of either provide a d
2010/6/3 Rich Hickey
> [...]
> I don't have a means to prevent this at present, but I'd like to
> suggest this policy moving forward:
>
> If a protocol comes with Clojure itself, avoid extending it to types
> you don't own, especially e.g. java.lang.String and other core Java
> interfaces. Rest
Hi,
Am 03.06.2010 um 21:51 schrieb Laurent PETIT:
>> (in-ns 'some.other.namespace)
>>
>> (let [orig-x some-x]
>> (defn some-x
>>[foo]
>>(if (my-foo? foo)
>> (do-stuff foo)
>> (orig-x foo
>
> Sorry Meikel, but I'm having trouble following you today.
> Does the above examp
> May I add this policy concerning Clojure protocols (as well as the rule "one
> must only extend a protocol to a type if he owns either the type or the
> protocol. If one breaks the rule, one should be prepared to withdraw should
> the implementor of either provide a definition") to the assembl
2010/6/3 Rich Hickey
>
>
> On Jun 3, 9:28 am, Laurent PETIT wrote:
> > Hi,
> >
> > 2010/6/3 Christophe Grand
> >
> >
> >
> >
> >
> > > On Thu, Jun 3, 2010 at 1:56 PM, Laurent PETIT >
> > > wrote:
> > > > If I understand things well, one problem with ruby monkey patching is
> > > that
> > > > i
2010/6/3 Meikel Brandmeyer
> Hi,
>
> Am 03.06.2010 um 16:16 schrieb Laurent PETIT:
>
> > I think I clearly understand the benefits of namespaces in this case. I
> was reacting to Meikel's sentence:
> >
> > "And redefining things in foreign namespaces is rather not a technique we
> should support.
Hi,
Am 03.06.2010 um 16:16 schrieb Laurent PETIT:
> I think I clearly understand the benefits of namespaces in this case. I was
> reacting to Meikel's sentence:
>
> "And redefining things in foreign namespaces is rather not a technique we
> should support..."
I think what I meant was mentione
On Jun 3, 9:28 am, Laurent PETIT wrote:
> Hi,
>
> 2010/6/3 Christophe Grand
>
>
>
>
>
> > On Thu, Jun 3, 2010 at 1:56 PM, Laurent PETIT
> > wrote:
> > > If I understand things well, one problem with ruby monkey patching is
> > that
> > > if a library I use opens a class C and adds a method who
2010/6/3 Stuart Halloway
> The above point has been answered to Christophe. I was not talking about
> the way that namespacing will reduce the problem by allowing different
> function names (with probably different semantics) to live in different
> namespaces. This is no different than distinguis
> The above point has been answered to Christophe. I was not talking about the
> way that namespacing will reduce the problem by allowing different function
> names (with probably different semantics) to live in different namespaces.
> This is no different than distinguishing 2 ordinary function
Hi,
2010/6/3 Meikel Brandmeyer
> Hi,
>
> On Thu, Jun 03, 2010 at 01:56:36PM +0200, Laurent PETIT wrote:
>
> > Now to clojure. I can see the same problem occur, while the article's
> author
> > claims that in clojure there's (almost) no problem anymore.
> > If several libraries, including my prog
Hi,
2010/6/3 Christophe Grand
> On Thu, Jun 3, 2010 at 1:56 PM, Laurent PETIT
> wrote:
> > If I understand things well, one problem with ruby monkey patching is
> that
> > if a library I use opens a class C and adds a method whose signature is M
> to
> > it, and if in my own code I also open th
The surface of the problem is reduced because of namespacing: two
different "fold" methods (with different semantics) from two protocols
won't clash. Plus if there are two extensions of the same protocol to
the same type, they should be rather equivalent since they satisfies
the same semantics.
On 3 Jun 2010, at 13:56, Laurent PETIT wrote:
If I understand things well, one problem with ruby monkey patching
is that if a library I use opens a class C and adds a method whose
signature is M to it, and if in my own code I also open the same
class C and add a method whose signature is M
On Thu, Jun 3, 2010 at 1:56 PM, Laurent PETIT wrote:
> If I understand things well, one problem with ruby monkey patching is that
> if a library I use opens a class C and adds a method whose signature is M to
> it, and if in my own code I also open the same class C and add a method
> whose signatu
Hi,
On Thu, Jun 03, 2010 at 01:56:36PM +0200, Laurent PETIT wrote:
> Now to clojure. I can see the same problem occur, while the article's author
> claims that in clojure there's (almost) no problem anymore.
> If several libraries, including my program, redefine blindlessly a protocol
> implement
Hello,
The following article:
http://kirindave.tumblr.com/post/658770511/monkey-patching-gorilla-engineering-protocols-in
claims that, as far as code safety is concerned, clojure's solution is far
better than e.g. ruby monkey patching.
If I understand things well, one problem with ruby monkey p
18 matches
Mail list logo