From fffbe767e98408c2b2c08d77117c8e852b342dab Mon Sep 17 00:00:00 2001 From: Elizabeth Mattijsen Date: Thu, 27 Aug 2015 16:34:44 +0200 Subject: [PATCH] Get note in line with say (with all the quirks) --- src/core/io_operators.pm | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/core/io_operators.pm b/src/core/io_operators.pm index 5f00d0d87e0..2ef4a6bc82f 100644 --- a/src/core/io_operators.pm +++ b/src/core/io_operators.pm @@ -42,13 +42,15 @@ multi sub note(Str:D \x) { $err.print: x; $err.print-nl; } -# XXX GLR casualty -#multi sub note(\x) { -# my $err := $*ERR; -# $err.print: x.gist; -# $err.print-nl; -#} -multi sub note(*@args is rw) { +multi sub note(\args) { + my $err := $*ERR; + my \iterator := nqp::istype(args, Iterable) ?? args.iterator !! args.list.iterator; + until (my \value := iterator.pull-one) =:= IterationEnd { + $err.print(value.gist); + } + $err.print-nl; +} +multi sub note(**@args is rw) { my $err := $*ERR; $err.print(.gist) for @args; $err.print-nl;