in reply to Re: Thx, St. Larry, for the Beauty of Sigils
in thread Thx, St. Larry, for the Beauty of Sigils
The other problem is the frustrating learn curve of Perl, because we have a list form and a ref form of an array.
No, we have plain variables and references to variables (and functions). The distinction between plain and reference variables is well done IMHO.
But python is worse - it has list and tuple arrays
qwurx [shmem] ~> python Python 2.7.15+ (default, Nov 27 2018, 23:36:35) [GCC 7.3.0] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> foo = (1,2,3,4) >>> bar = [1,2,3,4] >>> type(foo) <type 'tuple'> >>> type(bar) <type 'list'> >>> bar[0] = 5 >>> foo[0] = 5 Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: 'tuple' object does not support item assignment >>> foo (1, 2, 3, 4) >>> bar [5, 2, 3, 4] >>>
and it isn't obvious which is which by looking at the identifier. A tuple is inmutable, a list can be assigned to.
This was a major WTF moment for me.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Thx, St. Larry, for the Beauty of Sigils
by LanX (Saint) on Jul 27, 2019 at 14:28 UTC | |
by shmem (Chancellor) on Jul 27, 2019 at 14:31 UTC | |
by LanX (Saint) on Jul 27, 2019 at 14:32 UTC | |
by shmem (Chancellor) on Jul 27, 2019 at 14:35 UTC | |
by LanX (Saint) on Jul 27, 2019 at 14:36 UTC | |
|