Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > what do you call funct ( funct())

Reply
Thread Tools

what do you call funct ( funct())

 
 
Ken Sington
Guest
Posts: n/a
 
      07-08-2004
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;

 
Reply With Quote
 
 
 
 
Gunnar Hjalmarsson
Guest
Posts: n/a
 
      07-08-2004
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
 
Reply With Quote
 
 
 
 
Brad Baxter
Guest
Posts: n/a
 
      07-08-2004
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
 
Reply With Quote
 
Ken Sington
Guest
Posts: n/a
 
      07-08-2004
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

 
Reply With Quote
 
Josef Moellers
Guest
Posts: n/a
 
      07-08-2004
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

 
Reply With Quote
 
Malcolm Dew-Jones
Guest
Posts: n/a
 
      07-08-2004
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
 
Reply With Quote
 
gnari
Guest
Posts: n/a
 
      07-08-2004
"Ken Sington" <ken_sington@nospam_abcdefg.com> wrote in message
news:(E-Mail Removed)...
> 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





 
Reply With Quote
 
Ken Sington
Guest
Posts: n/a
 
      07-09-2004
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".

 
Reply With Quote
 
Josef Moellers
Guest
Posts: n/a
 
      07-09-2004
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

 
Reply With Quote
 
Dale Henderson
Guest
Posts: n/a
 
      07-09-2004
>>>>> "JM" == Josef Moellers <(E-Mail Removed)> 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
who do you call when you're an ISP and have problems? richard Computer Support 10 01-25-2010 08:28 AM
What do you call it? How do you set it? Rob HTML 16 03-10-2007 07:49 PM
Have you ever had your computer crashed at 3am and wished that you had someone to call? lifestylelink Computer Support 10 08-12-2006 03:05 PM
How can you here when you've got a call through a headset? OM UK VOIP 4 09-27-2005 04:31 PM
do you what to sale any avon if you do call me at 2460028 kathy.turley Computer Support 1 09-18-2005 07:00 AM



Advertisments