On 2008-05-02, Pete <peter.charbonnier@[EMAIL PROTECTED]
> wrote:
> On May 2, 4:59 am, Duke Normandin <dukeofp...@[EMAIL PROTECTED]
> wrote:
>> On 2008-05-02, Pete <peter.charbonn...@[EMAIL PROTECTED]
> wrote:
>>
>>
>>
>> > On May 1, 5:05 pm, Duke Normandin <dukeofp...@[EMAIL PROTECTED]
> wrote:
>> >> On 2008-05-01, Rilian <no...@[EMAIL PROTECTED]
> wrote:
>>
>> >> > ****d references are bad - **** variables are encouraged.
>>
>> >> > Figure that one out. 8^)
>>
>> >> > Duke Normandin <dukeofp...@[EMAIL PROTECTED]
> wrote in
news:lFaSj.3318$PM5.2947
>> >> > @[EMAIL PROTECTED]
>>
>> >> >> Thanks for the great explanation! What is _your opinion_ of
>> >> >> "****d references" -- if you dare to go there. ;)
>>
>> >> You've _got_ to be sh....ing me!!
>> >> --
>> >> Duke Normandin
>>
>> > He is....a little.
>>
>> > Here's a quick explainer:
>>
>> > SET ^Cars("pickup",1)="Tundra" --- * Full global reference *
>> > SET ^(2)="Rabbit" --- * ****d global reference *
>>
>> So this implies that there pre-exists something like:
>> SET ^Cars("compact",2)="Rabbit" ??
>>
>> > SET ^(3)="ChevyS10" --- * Assume subscript level 2 *
>>
>> as well as:
>>
>> SET ^Cars("pickup",3)="ChevyS10" ??
>>
>> > SET ^(3,1)="ChevyS104liter" --- * Go to subscript level 3 *
>> > SET ^(2)="ChevyS106liter" --- * Assume subscript level 3 *
>>
>> > So a ****d global reference is one where the fully qualified global
>> > name "^Cars("pickup"," is implied and can be called with just the
>> > caret and the subscript number. You can see how ****d global
>> > references are unnessecarily confusing because they don't "spell it
>> > out" for the person reading the code. You've got to pick back
through
>> > in order to see what you're referencing and it drives me nuts.
>>
>> Now I see how easily "****d References" could quickly produce spaghetti
>> code. But why use them at all? Is there a _speed_ advantage? Something
>> else?
>> --
>> Duke Normandin
>
> The Rabbit was technically a pickup, described in my global example on
> the same level as the S10 and the Tundra, with just a name. In this
> example the logical extension would put:
>
> SET ^Cars("pickup",2,1)="RabbitLX"
>
> Where the LX was the version with the slightly larger engine. I
> think. I probably should have used a modern car reference.
Hey Pete....
Sorry! I wasn't critisizing your choice of models etc etc. I'm trying
understand the workings of Mumps, its database and subscripting and
indexing AND trying to figure what the hell a ****d reference is
vs a not-so-****d one. I made the wrong assumptions. So is _this_
correct:
SET ^Cars("pickup",1)="Tundra" --- * Full global reference *
SET ^Cars("pickup",2)="Ranger"
SET ^Cars("pickup",3)="S10"
SET ^(4)="Sonoma"
SET ^(5)="F150"
So to my un-trained eye, the on;y way that I know that ^(4) "points"
to ^Cars("pickup", ) is the very close proximity of the context. 50
lines of code later, the context would not be so obvious. Secondly,
how do I know for sure that ^(4) does in fact still "point" to
^Cars("pickup", ) ?? Seems like using these "****d references" is like
"an accident waiting to happen", no?
--
Duke Normandin


|