in reply to Re^11: Perl vs C
in thread Perl vs C
So write some code that modifies a "list". What would that be?
We're still waiting for you to show it's possible.
Some authors say that @xyz is a list and that xyz is an array variable that defines a list.
So far, I've only seen you, and that's the problem.
What's wrong with saying that @xyz is a list?
It's very confusing. It leads to contradictory statements. If we went by your definition, all of the following statements are true depending on whether you are talking about (foo,bar) or @foo.
[What's wrong with saying] that xyz in the context of @ is a list?
Now you want to redefine "context" too! What do you have against being understood.
[What's wrong with saying] that (@xyz >1) is a list in a scalar context?
You wouldn't be talking about Perl. In Perl, lists evaluate to their last element in scalar context.
print(scalar( ( 'a', 'b', 'c' ) )); # c
However, @xyz does not.
@xyz = ( 'a', 'b', 'c' ); print(scalar( @xyz )); # 3
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^13: Perl vs C
by Marshall (Canon) on Mar 16, 2009 at 17:02 UTC | |
by ikegami (Patriarch) on Mar 16, 2009 at 17:21 UTC | |
by Marshall (Canon) on Mar 16, 2009 at 17:53 UTC | |
by JavaFan (Canon) on Mar 16, 2009 at 18:03 UTC | |
by Marshall (Canon) on Mar 16, 2009 at 18:14 UTC | |
|