Re: Functions and subroutines?

2018-09-12 Thread Elizabeth Mattijsen
> 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

Re: Functions and subroutines?

2018-09-12 Thread Joseph Brenner
> 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

Re: Functions and subroutines?

2018-09-11 Thread Larry Wall
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

Re: Functions and subroutines?

2018-09-11 Thread Simon Proctor
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

Re: Functions and subroutines?

2018-09-11 Thread yary
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

Re: Functions and subroutines?

2018-09-11 Thread yary
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"

Functions and subroutines?

2018-09-11 Thread ToddAndMargo
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