Marshalling delegates

Ask a Question related to Ruby, Design and Development.

  1. #1

    Default Marshalling delegates

    I can't seem to marshal a delegate. The code below:

    class Foo < SimpleDelegate
    end

    Marshal.dump(Foo.new(nil))

    Gives me an error:
    TypeError: singleton can't be dumped

    The weird thing is that defining _dump or marshal_dump in Foo doesn't
    make this problem go away.
    Even stranger is that this error suddenly started showing up in code
    that used to work... I'm not sure what may haev changed in the interim
    (haven't touched the code in a few weeks), except I may have apt-get
    updated my ruby installation.

    Is there any way I can dump a delegate?

    Nathan
    Nathan Weston Guest

  2. Similar Questions and Discussions

    1. Delegates
      Hi, Anybody got any example code for the implement a custom delegate. Can't seem to find any examples!!.. Many thanks Gibbo
    2. Delegates in FMS
      Hi has anybody managed to get some sort of scoping class/object like a Delegate or Proxy to work with SERVER SIDE ACTIONSCRIPT? Not having much...
    3. Events and Delegates
      How in a asp.net web form can you have two different objects events call the same sub with different signatures. Example: I have 1 ImageButton...
    4. Singletons and Marshalling
      Does anyone know how singleton's and marshalling interact? In particular, I want to have my singleton class be able to dump and load (and be...
    5. marshalling C++
      I have a function with the following signature HRESULT func(BSTR id, VARIANT *retval); The variant gets filled with a SAFEARRAY of IDispatch...
  3. #2

    Default Re: Marshalling delegates

    Hi,

    In message "Marshalling delegates"
    on 03/11/21, Nathan Weston <elbows@spamcop.net> writes:

    |I can't seem to marshal a delegate. The code below:
    |
    |class Foo < SimpleDelegate
    |end
    |
    |Marshal.dump(Foo.new(nil))
    |
    |Gives me an error:
    |TypeError: singleton can't be dumped
    |
    |The weird thing is that defining _dump or marshal_dump in Foo doesn't
    |make this problem go away.

    It's a bug in 1.8.0. Soon to be fixed. Thank you.

    matz.


    Yukihiro Matsumoto 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