# New Ticket Created by  "Kyle Hasselbacher" 
# Please include the string:  [perl #67258]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=67258 >


This is my crack at implementing these two operators.  I'm looking for
feedback since I've never written for Rakudo before.

Thanks.

Kyle.
>From d83a888614383b80d30e5811f69ae974647628e0 Mon Sep 17 00:00:00 2001
From: Kyle Hasselbacher <k...@livetext.com>
Date: Mon, 6 Jul 2009 09:17:21 -0500
Subject: [PATCH] [setting] Simple implementation of [||] operator

---
 src/setting/Operators.pm |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/src/setting/Operators.pm b/src/setting/Operators.pm
index 4aa6a8a..1608a45 100644
--- a/src/setting/Operators.pm
+++ b/src/setting/Operators.pm
@@ -60,4 +60,12 @@ sub prefix:<[//]>(@a) {
     return ();
 }
 
+sub prefix:<[||]>(@a) {
+    for @a -> $item {
+        $item || next;
+        return $item;
+    }
+    return ();
+}
+
 # vim: ft=perl6
-- 
1.6.0.4

Reply via email to