On Wednesday 06 March 2002 11:38 pm, Paul C. Boyle wrote:
| Thank you for the kind reply Mike.
| I have been shown the elitist attude by others at times,
| and man I tell you its can bring a buy down.
|
| On March 6, 2002 04:54 pm, you wrote:
| > > minimal exposure to these.) I have looked a Python and found it a bit
| > > confusing not having to delare everything and aslo it has no unary
| > > opperator.
| >
| > All languages have unary operators - at the very least negate, both
| > loagical and arithmeatic. Most modern ones have a boolean negate as
| > well.
|
| My comment was't meant to knock Python. I have read about Python and
| very much like what I have read.
| Just to tell you where I am coming from. I have taken a ten week night
| class in C++ 2 years ago. This was my first experience with programming.
| This just gave me the basics like , looping, functions, arrays, pointers as
| such. Since coming to Freebsd unix I found the majority of things is done
| in C. So I picked up the book Teach yourself C in 21 Days. Things are
| different here but they do make sense.
| Now looking at Python books things are a lot differently done.
| like how do you do a for loop as you would in C or C++.
|
| for ( x=0: x < 10 ; x ++ )
|
| Is the ++ not the unary operator?
No, ++ is *a* unary operator, not *the* unary operator. -- is another. - is
another. ! is another. ~ is another. There are a bunch: a unary operator
is any operator that takes a single operand, just as a binary operator is an
operator that takes two operaands. And a ternary operator is an operator
that takes three operands.
(There is "a" ternary operator, though; of commonly-used languages, C is
unique in having a ternary operator, and it only has one of them: the ? :
operator.)
Python doesn't have pre- and post- inrement- and decrment?
Well, neither do most languages--they are pretty much a quirky C construct
created, I suspect because they correlated to PDP-11 machine instructions
(addressing modes), which has since infiltrated a number of other languages.
But the lack of same is hardly a big deal. It'll cost you just a few
keystrokes.
OTOH, I do rather like x += 1 -- I think it clarifies what's going on as
compared to x = x + 1 . . . .
--
Brian T. Schellenberger . . . . . . . [EMAIL PROTECTED] (work)
Brian, the man from Babble-On . . . . [EMAIL PROTECTED] (personal)
ME --> http://www.babbleon.org
http://www.eff.org <-- GOOD GUYS --> http://www.programming-freedom.org
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message