having #0 carry thru abstractions within abstractions

    Jun 27 2007 | 4:52 am
    Hi all, I know there is a way to do this (well I think there is), but I'm not having any luck finding it anywhere. Here's my story (it's a page turner): you make an abstraction with say, "r #0_foo". When instantiated, #0 gets filled in by a randomly generated number. Now let's say this abstraction has within it another abstraction, with an "r #0_foo". Now for my purposes, I'd like both #0 to be the same within this little abstraction within an abstraction, but you get different numbers (and this is actually expected). BUT...I seem to recall somewhere in the dark recess of my brain a way of accomplishing this using "---" somwhere in place of, or next to, or on top of, #0. Then each of these abstraction-within-an-abstraction sets share same receive arguments, but data isn't shared across other similar abstraction-within-an-abstraction sets. Any combo I've come up with has proven fruitless, and doing a search for "---" or #(anything) doesn't produce any hits in the forum. Am I smokin' something? Is this possible? Certainly I have a workaround, but am looking to streamline some patches a bit.
    Thanks in advance, David

    • Jun 27 2007 | 5:08 am
      Hi David,
      You can definitely do this using a combination of #0 and #1. The abstraction within the abstraction should have #1 as it's argument which it will replace with the instantiated value of #0 it receives from the parent abstraction.
      Also, check out pvar as well as the forward object. Though you can use #0, what it really sounds like you want is a scoped variable...
      Peter McCulloch