I'm sure this has been covered elsewhere, but I couldn't find it. Given a
function, such as:

sum: func ["Return the sum of two numbers."
    arg1 [number!] "first number"
    arg2 [number!] "second number"
    /avg "return the average of two numbers"
    /sub "subtracts the first from the second"
    /div "divides the first into the second"
][
    switch/default self/refinement [
        avg [arg1 + arg2 / 2]
        sub [arg1 - arg2]
        div [arg1 / arg2]
    ][arg1 + arg2]
]

Is there a way to dynamically obtain a refinement value so I can use it in a
switch statement?
In the example above, the pseudo-code expression "self/refinement" is what
I'm looking for.

Odd that I've never encountered this over the years. I'm sure someone here
can set me straight on it.

Thanks,
Ed


-- 
To unsubscribe from the list, just send an email to 
lists at rebol.com with unsubscribe as the subject.

Reply via email to