in reply to Re: How to distinct the call position of a sub?
in thread How to distinct the call position of a sub?

Well ... would you publish a syntax extension with the footnote "but never use it in the same line!" ?

And beside this, iterator are just an example for a general problem to know "which call is this".

Think about a position sensitive function you want to call twice within a ternary operator ... "never use it in the same line?"

And even when I publish it with this restriction, I have no means to throw an error-message if used in a wrong way.

So if there is a general clean solution, where else should I try to ask for wisdom?
And shouldn't I ask before implementing an imperfect solution? 8 )

Cheers Rolf

  • Comment on Re^2: How to distinct the call position of a sub?

Replies are listed 'Best First'.
Re^3: How to distinct the call position of a sub?
by kyle (Abbot) on Nov 24, 2008 at 21:21 UTC

    And beside this, iterator are just an example for a general problem to know "which call is this".

    I don't think there's a reliable solution, which is why I think any design based on having this information is flawed. What do you expect to get if you're called from string eval?

      > What do you expect to get if you're called from string eval?

      what do you expect when you call foreach from string eval?
      Well you bring a good argument against using the linenumber from caller.

      Cheers Rolf