However, there seems to be a demand for importing by hard link, also. This is easy for other types of symbols, but a contradiction for functions. That is, $x => \$_internal_x is distinguishable from $y => \&generate_y, but if the symbol is itself a function, you can't tell them apart.
Originally I decided to let it mean “call back”, since you can write &foo => sub { \&_hard_link } to get the other case. But can it be simpler/easier?
Well, I think I've got it!
How about, for function symbols, a code ref means “now”, and a ref to a scalar means “later”?
That is,
The extra backslash is only one more character, rather than any other form of decorating it which has to surround it and/or involve more words. And, the meaning of backslash is consistant with “take it literally, not special meaning now”.&foo => \&figure_it_out, &bar => \\&hard_link
I think the idea would make a handy idiom for any situation like this, when you're configuring things with code blocks. For example, in user-interface building, Tk has a few forms with various semantics.
Any thoughts?
—John
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: callback or call now?
by grinder (Bishop) on Oct 16, 2002 at 21:49 UTC | |
|
Re: callback or call now?
by rir (Vicar) on Oct 17, 2002 at 01:42 UTC | |
by John M. Dlugosz (Monsignor) on Oct 17, 2002 at 14:59 UTC | |
by rir (Vicar) on Oct 17, 2002 at 17:12 UTC | |
by John M. Dlugosz (Monsignor) on Oct 17, 2002 at 18:13 UTC | |
by rir (Vicar) on Oct 17, 2002 at 21:30 UTC | |
|
Re: callback or call now?
by erikharrison (Deacon) on Oct 17, 2002 at 16:13 UTC | |
by John M. Dlugosz (Monsignor) on Oct 17, 2002 at 18:20 UTC |