what do you call funct ( funct())

K

Ken Sington

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;
 
G

Gunnar Hjalmarsson

Ken said:
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>
 
B

Brad Baxter

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
 
K

Ken Sington

Brad said:
.

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?
 
J

Josef Moellers

Ken said:
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".
 
M

Malcolm Dew-Jones

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
 
G

gnari

Ken Sington said:
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
 
K

Ken Sington

Josef said:
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.
 
J

Josef Moellers

Ken said:
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:

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".
 
D

Dale Henderson

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.
 
J

Joe Smith

Dale said:
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 ...

Dale,
Whenever I see one of your postings, it takes more brain power to
parse, since you don't put your text at the left margin like everybody
else does. Is there a particular reason why you use this non-standard
style?
-Joe
 
J

Josef Moellers

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.

As I'm already known to be a pedant and trying to show off:
I was using an implication:

"at right angles" -> "linearly independency"
This is all WAY off topic and further discussion should be moved
to sci.math.

I don't really want to discuss this particular subject.

<EOD>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top