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
Looks like that whole section needs to be rewritten. None of the examples with binding produce described results, so I think the behavior of loop in such form has changed.
Also, using only the loop {...} to make a sequence leaves out much neater things like the sequence operator: 0, 2 ... * might be a better example to use, or at least it should be mentioned. It also works with the binding examples, although the part demonstrating how elements get generated becomes undemonstrative.
zoffixznet
changed the title
Sequence example triggers an endless loop instead of error
Sequence examples no longer work as advertized / section could use improvement
Apr 6, 2016
JJ
changed the title
Sequence examples no longer work as advertized / section could use improvement
Sequence examples no longer work as advertised / section could use improvement
Apr 17, 2018
JJ
added
the
update
part of "docs" - indicates this is an update for an existing section; rewrite, clarification, etc.
label
Apr 17, 2018
my @s := Seq.new(<a b c>); CATCH { default { say .^name, ' ', .Str } }
# OUTPUT «Type check failed in binding to $iter; expected Iterator but got List ($("a", "b", "c")) in block <unit> at <tmp> line 1»
It's trying to show that you can't bind a Seq to a Positional variable, but it's constructing the Seq incorrectly and gets the wrong error. It's meant to be <a b c>.Seq and then the error message will be different; actually saying that you can't bind stuff.
Although I can't say if this is a bug or a documentation error.
It's a known bug. IIRC it's trying to reify the Seq with .perl to show a bit of its guts in the error message and ends up reifying forever.
Hello
In page http://doc.perl6.org/language/list#Sequences , the following example:
triggers an endlees loop instead of the error mentioned in comment (tested with rakudo 2016.03).
Although I can't say if this is a bug or a documentation error.
All the best
The text was updated successfully, but these errors were encountered: