> On 12 Sep 2018, at 22:56, Joseph Brenner wrote:
> With perl6, I find myself stumbling over what to call the built-ins...
> "functions", "commands", "keywords”?
perhaps “builtins"?
Liz
> they were all just subs.
With perl5 code, I've gravitated to talking about "routines" when I don't
want to worry about whether something is technically a function or a
method. It doesn't seem to confuse anyone. (On the other hand, I've had
people make fun of me for using the word
On Tue, Sep 11, 2018 at 03:47:46AM -0700, ToddAndMargo wrote:
: In Perl, what is the proper terminology?
We're not picky, since Perl has never made a hard and fast distinction
between routines that return values and routines that don't. You can call
them all functions or routines or procedures
There are also Blocks like : my $a = do { 5 }; say $a; (Gives 5);
Blocks turn up all over the place big different between blocks and Routines
(Sub or Method) is you can't return from them. They will return the last
thing evaluated within them though. But a return statement inside one
raises and
And looking at questions in other threads- there are subroutines declared
with "sub", those get called without an invocant.
sub i-am-a-sub() { say "Hi from subroutine land!" }
i-am-a-sub; # says "Hi from subroutine land!"
and methods are declared inside a class, and are called with an invocant
I would call them subroutines, since that's the long form of "sub"
-y
On Tue, Sep 11, 2018 at 3:47 AM, ToddAndMargo wrote:
> Hi All,
>
> I use subs like ducks use water. It is about time
> I learned what to properly call them.
>
> I come from Modula2 and Pascal (as well as bash), "functions"
Hi All,
I use subs like ducks use water. It is about time
I learned what to properly call them.
I come from Modula2 and Pascal (as well as bash), "functions"
return a value outside the declared parameters and "(sub)routines"
only can modify values through the declarations parameters.
Sort of