January 13, 2006
Carlos Santander wrote:

> It's like boolean operators mean different things in programming languages than in natural languages: "women and children first", "do you want chicken or fish?". I understood that printf as saying "this is common for Windows and Linux".

Correct, it turned out it was my mistake and not the original poster.

>> version(win,lin) {
>> printf("Windows & Linux\n");

Just like you said, it should be:

version(win)
    version = win_or_lin;

version(lin)
    version = win_or_lin;

version(win_or_lin) {
  printf("Windows & Linux\n");
}

Also, and even funnier, is that "win" or "lin" aren't right either.
As per Walter's spelling prefs, it should be "Windows" and "linux"

--anders
January 13, 2006
Carlos Santander wrote:
> Anders F Björklund escribió:
> 
>> Carlos Santander wrote:
>>
>>> Shouldn't it be:
>>>
>>> version(win)
>>>     version = win_or_lin;
>>>
>>> version(lin)
>>>     version = win_or_lin;
>>>
>>> version(win_or_lin) {
>>>   printf("Windows & Linux\n");
>>> }
>>>
>>> ? Otherwise, it doesn't make sense...
>>
>>
>> It was just an example, by the OP.
>>
>> s/win/Apples/; s/lin/Oranges; # :-)
>>
>> --anders
>>
>> PS. In your "corrected" example,
>>     printf("Windows | Linux\n");
> 
> 
> I know both things, but it just didn't make sense.
> 
> It's like boolean operators mean different things in programming languages than in natural languages: "women and children first", "do you want chicken or fish?". I understood that printf as saying "this is common for Windows and Linux".
> 
In natural language, in some cases they are not even boolean operators. For instance, 'or' when used in interrogatives has a "choice" meaning instead of a boolean meaning. Consider:

"Is this blue and red?"
Answers: 'Yes' or 'No'

"Is this blue or red?"
Answers: 'blue' or 'red'

And 'and' has more of a meaning of "addition, aggregation", which is more general than booleanness, altough it still works like that.

"Do this and that"
Meaning: "Do this and do that", more of aggregation like, since imperatives don't even have truth values.


-- 
Bruno Medeiros - CS/E student
"Certain aspects of D are a pathway to many abilities some consider to be... unnatural."
January 21, 2006
On 2006-01-12 16:24:43 -0800, Carlos Santander <csantander619@gmail.com> said:

> Anders F Björklund escribió:
>> Carlos Santander wrote:
>> 
>>> Shouldn't it be:
>>> 
>>> version(win)
>>>     version = win_or_lin;
>>> 
>>> version(lin)
>>>     version = win_or_lin;
>>> 
>>> version(win_or_lin) {
>>>   printf("Windows & Linux\n");
>>> }
>>> 
>>> ? Otherwise, it doesn't make sense...
>> 
>> It was just an example, by the OP.
>> 
>> s/win/Apples/; s/lin/Oranges; # :-)
>> 
>> --anders
>> 
>> PS. In your "corrected" example,
>>     printf("Windows | Linux\n");
> 
> I know both things, but it just didn't make sense.
> 
> It's like boolean operators mean different things in programming languages than in natural languages: "women and children first", "do you want chicken or fish?". I understood that printf as saying "this is common for Windows and Linux".
> 
> Anyway, when the OP actually codes, he'll see what he really wanted.

Sounds like you haven't been programming for long enough :)  Eventually you'll just answer True to those questions.

-S.

1 2
Next ›   Last »