Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Perl Misc (http://www.velocityreviews.com/forums/f67-perl-misc.html)
-   -   what do you call funct ( funct()) (http://www.velocityreviews.com/forums/t887190-what-do-you-call-funct-funct.html)

Ken Sington 07-08-2004 01:20 AM

what do you call funct ( funct())
 
ok it works, but what do you call this:

the eq test in this ternary op.
$answer = $test eq "value" ? "true" : "false";

or

the function in this if:
if ( myFnct("blah") ){
# it works
}




or


the uc($a) in the split. or squeezing all that inside
the sort

@temp = sort {
my $aa=(split '\|',uc($a), $colW)[$colZ];
my $bb=(split '\|',uc($b), $colW)[$colZ];
$aa=~ s/\W+//g;
$bb=~ s/\W+//g;
$aa cmp $bb;
} @db;


Gunnar Hjalmarsson 07-08-2004 01:32 AM

Re: what do you call funct ( funct())
 
Ken Sington wrote:
> ok it works,


Excuse me, but exactly *what* is it that works? You may not have
noticed, but there are more than one thread going on in this group...

> but what do you call this:


<various code snippets out of context snipped>

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

Brad Baxter 07-08-2004 02:11 AM

Re: what do you call funct ( funct())
 
On Wed, 7 Jul 2004, Ken Sington wrote:

> ok it works, but what do you call this:
>
> the eq test in this ternary op.
> $answer = $test eq "value" ? "true" : "false";


A test for equality.


> or
>
> the function in this if:
> if ( myFnct("blah") ){
> # it works
> }


A function call.


> or
>
>
> the uc($a) in the split.


A builtin function call.


> [ ... ] or squeezing all that inside
> the sort


A code block.


> @temp = sort {
> my $aa=(split '\|',uc($a), $colW)[$colZ];
> my $bb=(split '\|',uc($b), $colW)[$colZ];
> $aa=~ s/\W+//g;
> $bb=~ s/\W+//g;
> $aa cmp $bb;
> } @db;



But what are you asking?

Regards,

Brad

Ken Sington 07-08-2004 05:48 AM

Re: what do you call funct ( funct())
 
Brad Baxter wrote:

> On Wed, 7 Jul 2004, Ken Sington wrote:
>

....
>
> But what are you asking?
>


I mean, the fact that you can run a function inside that ternary, inside
that if. the fact that you can run a function inside a control structure.

is there a name for the concept?
If I wanted to explain to someone that you can do those things, what would I call this topic?

> Regards,
>
> Brad


Josef Moellers 07-08-2004 06:38 AM

Re: what do you call funct ( funct())
 
Ken Sington wrote:
> Brad Baxter wrote:
>
>> On Wed, 7 Jul 2004, Ken Sington wrote:
>>

> ...
>
>>
>> But what are you asking?
>>

>
> I mean, the fact that you can run a function inside that ternary, inside
> that if. the fact that you can run a function inside a control structure.
>
> is there a name for the concept?
> If I wanted to explain to someone that you can do those things, what
> would I call this topic?


orthogonality?

This means that there are rules that describe what you can do and there
are very few (down to "no") exceptions to these rules.
Like: "a function can return a value and this value can be used in an
expression" and "the condition of a conditional operator is an expression".
--
Josef Möllers (Pinguinpfleger bei FSC)
If failure had no penalty success would not be a prize
-- T. Pratchett


Malcolm Dew-Jones 07-08-2004 07:12 AM

Re: what do you call funct ( funct())
 
Ken Sington (ken_sington@nospam_abcdefg.com) wrote:
: Brad Baxter wrote:

: > On Wed, 7 Jul 2004, Ken Sington wrote:
: >
: ...
: >
: > But what are you asking?
: >

: I mean, the fact that you can run a function inside that ternary, inside
: that if. the fact that you can run a function inside a control structure.

: is there a name for the concept? : If I wanted to explain to someone
that you can do those things, what would I call this topic?

perhaps you want words like

grammar

syntax

semantics

expressions

operators

operator precedence

LL(1) LALR(1) (and some other similar acronyms)

parsers

gnari 07-08-2004 09:39 AM

Re: what do you call funct ( funct())
 
"Ken Sington" <ken_sington@nospam_abcdefg.com> wrote in message
news:O9-dnb-iTs6GfXHdRVn-jg@speakeasy.net...
> Brad Baxter wrote:
>
> > On Wed, 7 Jul 2004, Ken Sington wrote:
> >

> ...
> >
> > But what are you asking?
> >

>
> I mean, the fact that you can run a function inside that ternary, inside
> that if. the fact that you can run a function inside a control structure.
>
> is there a name for the concept?
> If I wanted to explain to someone that you can do those things, what would

I call this topic?

you are thinking on expressions.

the if() test is a boolean expression. funtion calls are allowed
in expressions. some languages differentiate between procedures and
functions. the difference is that the functions return a value and
can thus be used in expressions.

gnari






Ken Sington 07-09-2004 01:53 AM

Re: what do you call funct ( funct())
 
Josef Moellers wrote:
> Ken Sington wrote:

....

....

>
> orthogonality?
>

I almost dismissed it. never knew there was such a word.

I looked it up in the dictionary:
...sum of two products...

then google.com, and found lots of references to mathmatics.

then passed it around to my peers; almost no one had a clue.
the one who had a clue once again steered towards mathmatics.
and of course, to comp.sci.



> This means that there are rules that describe what you can do and there
> are very few (down to "no") exceptions to these rules.
> Like: "a function can return a value and this value can be used in an
> expression" and "the condition of a conditional operator is an expression".


Josef Moellers 07-09-2004 07:01 AM

Re: what do you call funct ( funct())
 
Ken Sington wrote:
> Josef Moellers wrote:
>
>> Ken Sington wrote:

>
> ...
>
> ...
>
>>
>> orthogonality?
>>

> I almost dismissed it. never knew there was such a word.
>
> I looked it up in the dictionary:
> ...sum of two products...
>
> then google.com, and found lots of references to mathmatics.


Yes, in mathematics I'd read it as being "at right angles" or whatever
linear algebra makes out of that. It then also bears the notion of two
vectors being independent of each other so they span a plane where you
can construct points out of both vectors independently, which probably
led to the adoption of this term in CS:

>> This means that there are rules that describe what you can do and
>> there are very few (down to "no") exceptions to these rules.
>> Like: "a function can return a value and this value can be used in an
>> expression" and "the condition of a conditional operator is an
>> expression".


I.e. what you can construct an expression of is one vector and what you
can put into a condition is another.

I've seen this term used very often in describing the architecture of
processors. There it e.g. refers to the addressing modes where some
processors allow arbitrary sources and destinations (e.g. PDP11, VAX,
M68K, NS32K) while others just allow certain combinations only.
The former call themselves "orthogonal".
--
Josef Möllers (Pinguinpfleger bei FSC)
If failure had no penalty success would not be a prize
-- T. Pratchett


Dale Henderson 07-09-2004 08:54 PM

Re: what do you call funct ( funct())
 
>>>>> "JM" == Josef Moellers <josef.moellers@fujitsu-siemens.com> writes:

JM> Ken Sington wrote:
>> Josef Moellers wrote:
>>> Ken Sington wrote:

>> ... ...
>>
>>> orthogonality?
>>>

>> I almost dismissed it. never knew there was such a word. I
>> looked it up in the dictionary: ...sum of two products... then
>> google.com, and found lots of references to mathmatics.


JM> Yes, in mathematics I'd read it as being "at right angles" or
JM> whatever linear algebra makes out of that.

"at right angles" is a fair description. The most technical
definition is that the inner product (dot product) of two vectors
is zero.

And since inner product and vector have very broad definitions so
to can orthogonality. For example:

If f,g are real-valued functions over the reals (i.e. f:R->R
g:R->R).

We can defined the inner product:

<f,g>=\int_R f(x)g(x) dx where \int_R is the integral over all
real numbers that is from -infinity to infinity.

So that f,g are orthogonal if <f,g>=0.



JM> It then also bears the notion of two vectors being independent
JM> of each other so they span a plane where you can construct
JM> points out of both vectors independently, which probably led
JM> to the adoption of this term in CS:


Vectors needn't be orthogonal to be linearly independent. For
example (0,1) and (1,1) are linearly independent and span the
plane but are not orthogonal, <(0,1),(1,1)>=1!=0.

This is all WAY off topic and further discussion should be moved
to sci.math.

--
Dale Henderson

"Imaginary universes are so much more beautiful than this stupidly-
constructed 'real' one..." -- G. H. Hardy


All times are GMT. The time now is 12:42 PM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57