Artifact
f8eceb5e7bf804f5840e850410603fd24ad2d2c3:
Ticket change
[f8eceb5e7b]
- New ticket
[2817506fffffffff|2817506fff] <i>list handling routines return the first element of a list in</i>.
by
sletts on
2009-07-06 16:04:06.
D 2009-07-06T16:04:06
J assignee dkf
J cmimetype text/plain
J comment Problem\salso\sshows\sup\sin\s8.6.b,\snot\sthere\sin\s8.4.4.\sTested\son\sWindows,\sLinux\s(32\s&\s64\sbit)\s&\sSolaris.\n\nMany\slist\shandling\sroutines\sreturn\sthe\sfirst\selement\sof\sa\slist\sincorrectly\swhen\sthat\selement\sstarts\swith\s#.\n\nMaybe\sthe\sbehaviour\sis\sdue\sto\sa\smeaning\sof\sthe\s#\ssymbol\sthat\sI\sdon't\sknow\sabout\sor\smaybe\sit's\sa\sbug.\nAt\sany\srate\sit's\sdifferent\sin\s8.5\s&\s8.6\sfrom\s8.4.\n\n\nThe\sproblem\scan\sbe\sdemonstrated\strivially.\sN.B.\slist\sand\slrange\sare\snot\sthe\sonly\sroutines\sthat\sshow\sthis.\n\nset\sl00\s{#1\s#2\s#3\s#4}\n=>\s#1\s#2\s#3\s#4\nset\sl01\s[list\s#1\s#2\s#3\s#4]\n=>\s{#1}\s#2\s#3\s#4\n\nset\sl02\s[lrange\s$l00\s0\send]\n=>\s{#1}\s#2\s#3\s#4\n\nset\sl10\s{1\s#2\s#3\s#4}\n=>\s1\s#2\s#3\s#4\nset\sl11\s[list\s1\s#2\s#3\s#4]\n=>\s1\s#2\s#3\s#4\n\nset\sl12\s[lrange\s$l10\s0\send]\n=>\s1\s#2\s#3\s#4\nset\sl13\s[lrange\s$l11\s0\send]\n=>\s1\s#2\s#3\s#4\n\nset\sl14\s[lrange\s$l10\s1\send]\n=>\s{#2}\s#3\s#4\nset\sl15\s[lrange\s$l10\s1\send]\n=>\s{#2}\s#3\s#4\n\n\nOne\sworkaround\sfor\sthese\ssimple\sexamples\sis\sto\srebuild\sthe\slist\susing\sappend.\n\nfor\s{set\si\s0}\s{$i\s<\s[llength\s$l02]}\s{incr\si}\s{\n\s\s\sappend\sl03\s"\s"\s[lindex\s$l02\s$i]\n}\nputs\sstdout\s$l03\n=>\s#1\s#2\s#3\s#4\n\n\nI've\snow\snoticed\sanother\soddity\sin\sthis\sarea.\n\nconcat\s$l02\s$l02\n=>\s{#1}\s#2\s#3\s#4\s#1\s#2\s#3\s#4\nbut\nconcat\s$l03\s$l03\n=>\s#1\s#2\s#3\s#4\s{#1}\s#2\s#3\s#4\n\n
J foundin obsolete:\s8.5.7
J is_private 0
J priority 5\sMedium
J resolution None
J status Open
J submitter sletts
J subsystem 17.\sCommands\sI-L
J title list\shandling\sroutines\sreturn\sthe\sfirst\selement\sof\sa\slist\sin
J type Bug
K 2817506fffffffffffffffffffffffffffffffff
U sletts
Z cbc0f712eb6602e3ac0803d11a95fb99