You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is just a cheap way for me to add a quick note: the binding issue seems to be tied to destructuring in particular; my \k = .split: "|"; will work just fine, my (\k, \l) = .split: "|"; will cause problems.
PS: By the way, could the Github Discussions tab turned on for this repo? It's probably simpler for adding notes like this than fully blown issues.
~$ raku -ne'my (\k, \v) = .split: "\t"; say \k => \v;'~/key_test_4_bruce.txt
\("k"=> \("KEY2"))
Cannot assign to a readonly variable or a value
in block <unit> at -e line 1
Note: I tried hinting the compiler by adding a numeric parameter to split (telling split how many resultant elements are desired), and saw no improvement.
Hi @jubilatious1 , I can't see here where you are doing anything that involves sigilless variables without destructuring - the my \k = .split("\t"); part. Obviously, that won't do the same thing - but at this point, I don't think that matters too much; it's not relevant for the bug itself.
% raku -ne'my (\k, \v) = .split: "\t"; say \k , \v;'~/key_test_4_bruce.txt
\("1")\("KEY2")
Cannot assign to a readonly variable or a value
in block <unit> at -e line 1% raku -ne'my \k = .split: "\t"; say \k ;'~/key_test_4_bruce.txt
\(("1", "KEY2").Seq)
\(("2", "VAL21").Seq)
\(("3", "VAL22").Seq)
\(("4", "VAL23").Seq)
\(("5", "VAL24").Seq)
% raku -ne'my \k = .split("\t").List; say \k ;'~/key_test_4_bruce.txt
\(("1", "KEY2"))
\(("2", "VAL21"))
\(("3", "VAL22"))
\(("4", "VAL23"))
\(("5", "VAL24"))
% raku -ne'my (\k,\v) = .split("\t").List; say \k,\v ;'~/key_test_4_bruce.txt
\("1")\("KEY2")
Cannot assign to a readonly variable or a value
in block <unit> at -e line 1
Reacted by Márton Polgár
Repository owner locked and limited conversation to collaborators on Feb 15, 2025
Activity
jubilatious1 commentedon Dec 21, 2024
Hi @2colours , the error I'm getting is "cannot assign to a read-only variable or value":
Now conventional sigil (works fine):
Now with "sigil-less" variables:
Note: I tried hinting the compiler by adding a numeric parameter to
split(tellingsplithow many resultant elements are desired), and saw no improvement.2colours commentedon Dec 21, 2024
Hi @jubilatious1 , I can't see here where you are doing anything that involves sigilless variables without destructuring - the
my \k = .split("\t");part. Obviously, that won't do the same thing - but at this point, I don't think that matters too much; it's not relevant for the bug itself.jubilatious1 commentedon Dec 21, 2024
Hi @2colours Let me try that: