Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^4: Spotting an empty array as argument

by ikegami (Patriarch)
on Mar 26, 2021 at 19:32 UTC ( [id://11130394]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Spotting an empty array as argument
in thread Spotting an empty array as argument

While prototype would normally be a useful thing to try, say can't be prototyped because it supports say FH ..., so a definitive answer can't be obtained from prototype here (assuming the lack of file handle support is acceptable).

Seeking work! You can reach me at ikegami@adaelis.com

Replies are listed 'Best First'.
Re^5: Spotting an empty array as argument
by LanX (Saint) on Mar 26, 2021 at 20:36 UTC
    > say can't be prototyped because it supports say FH ...,

    I can't follow, the fact that say is internally calling something like FH->print(@_,"\n") shouldn't have any consequence on the prototype.

    Hmmm ...

    I think what you mean is that this inhibits attempts to override say with another implementation, since it needs to act like an indirect method call, but with prototype magic.

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery

      the fact that say is internally calling something like FH->print(@_,"\n") shouldn't have any consequence on the prototype.

      It doesn't. It's the syntax that can't be recreated with a prototype.

      I think what you mean is that this inhibits attempts to override say with another implementation,

      Not at all. That's what the comment to which I replied said.

      I pointed out that's not necessarily relevant since the OP didn't ask to replicate all of say's syntax, and irrelevant parts of say can't be recreated using prototypes.

      It was a nitpick. It is, of course, entirely correct that the relevant behaviour of say can't be replicated with a prototype. It just can't be ascertained by the means used by the person to which I replied. This is all I said.

      Seeking work! You can reach me at ikegami@adaelis.com

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11130394]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (4)
As of 2024-03-29 08:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found