"stereotyping" (was: Strong Typing (Managing metadataabout attribute types) )

Ask a Question related to Ruby, Design and Development.

  1. #21

    Default Re: Method wrapper question (was "stereotyping (was ...))

    >>>>> "G" == Gavin Sinclair <gsinclair@soyabean.com.au> writes:

    G> Do both the :pre method wrappers get executed? If so, in what order?
    G> If not, which one does? And why not execute both?

    I really hope that ruby will give an message (method redefined) : I don't
    want to learn a new language and you have module to do what you want.


    Guy Decoux





    ts Guest

  2. Similar Questions and Discussions

    1. "stereotyping" (was: Strong Typing (Managing metadataabout attribute types) )
      > In sean's case, class and/or module were sufficient to define To be fair, he goes beyond class/module model. The reason we tend to object to...
    2. "stereotyping" (was: Strong Typing (Managing metadataabout attribute types)
      Simon, there is another way, the classes can be substantiated only on the remote end and all messages are routed to the remote object. the local...
    3. "stereotyping" (was: Strong Typing (Managing metadataabout attribute types)
      Simon, yes, i understood that the first time. (sorry, i just spent a couple of hours reading through hugely verbose posts that tended toward...
    4. "stereotyping" (was: Strong Typing (Managing metadataabout attribute types)
      On Thu, 2003-11-20 at 11:33, Weirich, James wrote: Well, you certainly captured my thoughts. That's exactly what I was suggesting with the...
    5. "stereotyping" (was: Strong Typing (Managing metadataabout attribute types)
      Sean O'Dell writes: know it they Charles Hixson writes: Several people have said this, and although true, this is not my main concern...
  3. #22

    Default Re: Method wrapper question (was "stereotyping (was ...))

    On Saturday, November 22, 2003, 11:47:50 PM, ts wrote:
    >>>>>> "G" == Gavin Sinclair <gsinclair@soyabean.com.au> writes:
    G>> Do both the :pre method wrappers get executed? If so, in what order?
    G>> If not, which one does? And why not execute both?
    > I really hope that ruby will give an message (method redefined) : I don't
    > want to learn a new language and you have module to do what you want.
    Well, I'm not sure what I want in this case. Wrapping methods is a
    great idea to satisfy a common idiom. I think it does seem a bit
    wrong not to allow multiple wrappers, though. The idiom as it stands
    (alias method to something else, and call alias from redefined method)
    can be used to wrap a method several times if desired.

    What method are you talking about? Oh, aspectr I suppose.

    Gavin



    Gavin Sinclair Guest

  4. #23

    Default Re: Method wrapper question (was "stereotyping (was ...))

    >>>>> "G" == Gavin Sinclair <gsinclair@soyabean.com.au> writes:

    G> Well, I'm not sure what I want in this case. Wrapping methods is a
    G> great idea to satisfy a common idiom. I think it does seem a bit
    G> wrong not to allow multiple wrappers, though. The idiom as it stands

    Perhaps in this case, you can also have multiple def in the same class :-)

    G> What method are you talking about?

    module B
    def a:pre
    end
    end

    class A
    include B

    def a:pre
    end

    def a
    end
    end


    Guy Decoux





    ts Guest

  5. #24

    Default Re: "stereotyping" (was: Re: Strong Typing (Re: Managing metadataabout attribute types) )

    Yukihiro Matsumoto wrote:
    >Hi,
    >
    >In message "Re: "stereotyping" (was: Re: Strong Typing (Re: Managing metadata about attribute types) )"
    > on 03/11/21, "Sean O'Dell" <sean@celsoft.com> writes:
    >
    >|This is, I think, the clearest I can make the new proposal tonight:
    >|
    >|[url]http://www.rubygarden.org/ruby?InterfaceContracts[/url]
    >
    >...
    >
    > matz.
    >p.s.
    >Please do not use bad words everyone.
    >
    Perhaps one could make assertions about parameters / methods that could
    be checked?
    e.g.

    class someclass < someOtherClass
    assert .kind_of(someClass, Number)
    def initialize (foo, bar)
    assert.responds_to(foo, +)
    assert.kind_of(bar, Number)
    ...
    end
    ...
    end

    The only advantage I see of this over the normal responds_to? and
    kind_of? is that it could be enabled or disabled by either a flag or by
    a global variable ($DEBUG or possibly $ASSERT instead). assert
    appears slightly special in that since it doesn't require any import
    statement, it's probably added onto Object, and also I notice that the
    "+" operator was considered as a normal method without being attached to
    any variable (and methods would need to be able to go there too).
    Perhaps that argument should be quoted?

    This clearly doesn't answer all of the requirements, but it does answer
    some of them, and might assist in debugging. (And it appears to me that
    it would be simple for someone who understood Ruby better than I do to
    implement.) Clearly if this were to be intended as a serious checking
    tool it would need expansion, e.g. one would want a way to test that "+"
    could take either one or two arguments, and that those arguments could
    be numbers. A benefit of this approach is that it could probably be
    bolted on without any change to the interpreter itself (at least until
    it was decided to implement interpreter flags).



    Charles Hixson Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139