In response to Smoko
Smoko wrote:
It seems I'm by my self on this style.

Yes. Yes, it does. =)

I don't advocate either Tomism or Danism particularly (though I almost always use the Danist style in my own code), but I do advocate consistency!

Still, each to their own. Whatever works.
In response to Crispy
Crispy wrote:
Smoko wrote:
It seems I'm by my self on this style.

Yes. Yes, it does. =)

I don't advocate either Tomism or Danism particularly (though I almost always use the Danist style in my own code), but I do advocate consistency!

Still, each to their own. Whatever works.

I suppose that would mean I am a nudist...
In response to Crispy
Crispy wrote:
Sigma isn't a for() loop. It's a summing function. Big difference.

the universal quantifier, ∀, is a loop.
In response to OneFishDown
Um. No it's not.

There are plenty of constructs that create ranges or sets or sums or whatever, but they're not actually loops. In any case, that's irrelevant, because my point is that none of them are called for(). for() is not a function, it's a looping construct. It has no direct equivalent in mathematics.
In response to Crispy
Crispy wrote:
Um. No it's not.

it means "for all"... so, um, yes it is.

There are plenty of constructs that create ranges or sets or sums or whatever, but they're not actually loops.

creating a range or a set is as simple as saying "{1,2,3}", or "[1,10]", but iterating over that set is different, and that's where those other mathematical constructs come in. a for loop iterates over a set of values.

In any case, that's irrelevant, because my point is that none of them are called for().

so is it the name that matters or the function it performs?

for() is not a function, it's a looping construct. It has no direct equivalent in mathematics.

∀x | x ∈ Z ∧ x ≥ 1 ∧ x ≤ 10

which roughly translates to: for all x such that x is an element of the set of integers, and x is greater than or equal to one, and x is less than or equal to 10.

for(var/x = 1 to 10)

same thing =)
In response to OneFishDown
OneFishDown wrote:
In any case, that's irrelevant, because my point is that none of them are called for().

so is it the name that matters or the function it performs?

Both. My point is that the for loop as used in programming is not a function and does not come from mathematics.

Go and look up functional programming, which is as close as programming gets to pure mathematics. There's no for loop as such. There are plenty of iterative and recursive constructs that can be used to similar effect, but they're not for loops; nobody calls them for loops and they don't look like for loops.

same thing =)

Eh. I'm still not entirely convinced, but I'm going to give you the benefit of the doubt because I'm sick of this argument; it's just going round and round in circles and it's ultimately pointless. =P
In response to Crispy
if you want to argue that nothing in math is specifically a "for loop", then you'd probably be right. however, since mathematics came about a few years before computers did, mathematics already had a name for "for loops" and other ways of representing them. programming concepts have mathematical foundations, but not many people have a "∀" key on their keyboard. so in the interest of making code more readable and understandable (and typeable), it was given the name "for".
Page: 1 2