incubator-nuvem-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jsdelf...@apache.org
Subject svn commit: r1074928 - in /incubator/nuvem/trunk/nuvem-parallel: ./ nuvem/
Date Sat, 26 Feb 2011 21:09:27 GMT
Author: jsdelfino
Date: Sat Feb 26 21:09:25 2011
New Revision: 1074928

URL: http://svn.apache.org/viewvc?rev=1074928&view=rev
Log:
Add more useful component implementations to work with urls, text, operators, iterate through lists, maps etc.

Added:
    incubator/nuvem/trunk/nuvem-parallel/nuvem/add.py
      - copied, changed from r1072728, incubator/nuvem/trunk/nuvem-parallel/nuvem/and_.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/append.py
      - copied, changed from r1072728, incubator/nuvem/trunk/nuvem-parallel/nuvem/first.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/assoc.py
      - copied, changed from r1072728, incubator/nuvem/trunk/nuvem-parallel/nuvem/first.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/contains.py
      - copied, changed from r1072728, incubator/nuvem/trunk/nuvem-parallel/nuvem/and_.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/divide.py
      - copied, changed from r1072728, incubator/nuvem/trunk/nuvem-parallel/nuvem/and_.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/email.py
      - copied, changed from r1072728, incubator/nuvem/trunk/nuvem-parallel/nuvem/text.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/fbprofile.py
      - copied, changed from r1072728, incubator/nuvem/trunk/nuvem-parallel/nuvem/and_.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/find.py
      - copied, changed from r1072728, incubator/nuvem/trunk/nuvem-parallel/nuvem/filter_.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/host.py
      - copied, changed from r1072728, incubator/nuvem/trunk/nuvem-parallel/nuvem/text.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/itemnb.py
      - copied, changed from r1072728, incubator/nuvem/trunk/nuvem-parallel/nuvem/first.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/join.py
      - copied, changed from r1072728, incubator/nuvem/trunk/nuvem-parallel/nuvem/and_.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/lowercase.py
      - copied, changed from r1072728, incubator/nuvem/trunk/nuvem-parallel/nuvem/first.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/map_.py
      - copied, changed from r1072728, incubator/nuvem/trunk/nuvem-parallel/nuvem/foreach.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/multiply.py
      - copied, changed from r1072728, incubator/nuvem/trunk/nuvem-parallel/nuvem/and_.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/page.py
      - copied, changed from r1072728, incubator/nuvem/trunk/nuvem-parallel/nuvem/first.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/params.py
      - copied, changed from r1072728, incubator/nuvem/trunk/nuvem-parallel/nuvem/text.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/path.py
      - copied, changed from r1072728, incubator/nuvem/trunk/nuvem-parallel/nuvem/text.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/range_.py
      - copied, changed from r1072728, incubator/nuvem/trunk/nuvem-parallel/nuvem/and_.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/realm.py
      - copied, changed from r1072728, incubator/nuvem/trunk/nuvem-parallel/nuvem/text.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/reduce_.py
      - copied, changed from r1072728, incubator/nuvem/trunk/nuvem-parallel/nuvem/filter_.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/replace.py
      - copied, changed from r1072728, incubator/nuvem/trunk/nuvem-parallel/nuvem/and_.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/reverse.py
      - copied, changed from r1072728, incubator/nuvem/trunk/nuvem-parallel/nuvem/and_.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/split.py
      - copied, changed from r1072728, incubator/nuvem/trunk/nuvem-parallel/nuvem/and_.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/subtract.py
      - copied, changed from r1072728, incubator/nuvem/trunk/nuvem-parallel/nuvem/and_.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/twprofile.py
      - copied, changed from r1072728, incubator/nuvem/trunk/nuvem-parallel/nuvem/and_.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/uppercase.py
      - copied, changed from r1072728, incubator/nuvem/trunk/nuvem-parallel/nuvem/first.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/user.py
      - copied, changed from r1072728, incubator/nuvem/trunk/nuvem-parallel/nuvem/text.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/valueof.py
      - copied, changed from r1072728, incubator/nuvem/trunk/nuvem-parallel/nuvem/filter_.py
Removed:
    incubator/nuvem/trunk/nuvem-parallel/nuvem/foreach.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/pair.py
Modified:
    incubator/nuvem/trunk/nuvem-parallel/nuvem/and_.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/empty.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/equals.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/false_.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/filter_.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/first.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/greater.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/if_.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/lesser.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/list_.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/name.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/not_.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/nothing.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/number.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/or_.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/rest.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/text.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/true_.py
    incubator/nuvem/trunk/nuvem-parallel/test.py

Copied: incubator/nuvem/trunk/nuvem-parallel/nuvem/add.py (from r1072728, incubator/nuvem/trunk/nuvem-parallel/nuvem/and_.py)
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/add.py?p2=incubator/nuvem/trunk/nuvem-parallel/nuvem/add.py&p1=incubator/nuvem/trunk/nuvem-parallel/nuvem/and_.py&r1=1072728&r2=1074928&rev=1074928&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/and_.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/add.py Sat Feb 26 21:09:25 2011
@@ -15,6 +15,6 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-def get(id, a, b):
-    return a.get(()) and b.get(())
+def get(r, a, b):
+    return float(a.get(r)) + float(b.get(r))
 

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/and_.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/and_.py?rev=1074928&r1=1074927&r2=1074928&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/and_.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/and_.py Sat Feb 26 21:09:25 2011
@@ -15,6 +15,6 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-def get(id, a, b):
-    return a.get(()) and b.get(())
+def get(r, a, b):
+    return a.get(r) and b.get(r)
 

Copied: incubator/nuvem/trunk/nuvem-parallel/nuvem/append.py (from r1072728, incubator/nuvem/trunk/nuvem-parallel/nuvem/first.py)
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/append.py?p2=incubator/nuvem/trunk/nuvem-parallel/nuvem/append.py&p1=incubator/nuvem/trunk/nuvem-parallel/nuvem/first.py&r1=1072728&r2=1074928&rev=1074928&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/first.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/append.py Sat Feb 26 21:09:25 2011
@@ -15,6 +15,6 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-def get(id, l):
-    return l.get(())[0]
+def get(r, a, b):
+    return a.get(r) + b.get(r)
 

Copied: incubator/nuvem/trunk/nuvem-parallel/nuvem/assoc.py (from r1072728, incubator/nuvem/trunk/nuvem-parallel/nuvem/first.py)
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/assoc.py?p2=incubator/nuvem/trunk/nuvem-parallel/nuvem/assoc.py&p1=incubator/nuvem/trunk/nuvem-parallel/nuvem/first.py&r1=1072728&r2=1074928&rev=1074928&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/first.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/assoc.py Sat Feb 26 21:09:25 2011
@@ -15,6 +15,6 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-def get(id, l):
-    return l.get(())[0]
+def get(r, a, b):
+    return (a.get(r), b.get(r))
 

Copied: incubator/nuvem/trunk/nuvem-parallel/nuvem/contains.py (from r1072728, incubator/nuvem/trunk/nuvem-parallel/nuvem/and_.py)
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/contains.py?p2=incubator/nuvem/trunk/nuvem-parallel/nuvem/contains.py&p1=incubator/nuvem/trunk/nuvem-parallel/nuvem/and_.py&r1=1072728&r2=1074928&rev=1074928&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/and_.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/contains.py Sat Feb 26 21:09:25 2011
@@ -15,6 +15,6 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-def get(id, a, b):
-    return a.get(()) and b.get(())
+def get(r, sub, s):
+    return s.get(r).find(sub.get(r)) != -1
 

Copied: incubator/nuvem/trunk/nuvem-parallel/nuvem/divide.py (from r1072728, incubator/nuvem/trunk/nuvem-parallel/nuvem/and_.py)
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/divide.py?p2=incubator/nuvem/trunk/nuvem-parallel/nuvem/divide.py&p1=incubator/nuvem/trunk/nuvem-parallel/nuvem/and_.py&r1=1072728&r2=1074928&rev=1074928&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/and_.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/divide.py Sat Feb 26 21:09:25 2011
@@ -15,6 +15,6 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-def get(id, a, b):
-    return a.get(()) and b.get(())
+def get(r, a, b):
+    return float(a.get(r)) / float(b.get(r))
 

Copied: incubator/nuvem/trunk/nuvem-parallel/nuvem/email.py (from r1072728, incubator/nuvem/trunk/nuvem-parallel/nuvem/text.py)
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/email.py?p2=incubator/nuvem/trunk/nuvem-parallel/nuvem/email.py&p1=incubator/nuvem/trunk/nuvem-parallel/nuvem/text.py&r1=1072728&r2=1074928&rev=1074928&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/text.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/email.py Sat Feb 26 21:09:25 2011
@@ -15,6 +15,6 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-def get(id, prop):
+def get(r, prop):
     return prop.eval()
 

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/empty.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/empty.py?rev=1074928&r1=1074927&r2=1074928&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/empty.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/empty.py Sat Feb 26 21:09:25 2011
@@ -15,6 +15,6 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-def get(id):
+def get(r):
     return ()
 

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/equals.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/equals.py?rev=1074928&r1=1074927&r2=1074928&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/equals.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/equals.py Sat Feb 26 21:09:25 2011
@@ -15,6 +15,6 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-def get(id, a, b):
-    return a.get(()) == b.get(())
+def get(r, a, b):
+    return a.get(r) == b.get(r)
 

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/false_.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/false_.py?rev=1074928&r1=1074927&r2=1074928&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/false_.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/false_.py Sat Feb 26 21:09:25 2011
@@ -15,6 +15,6 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-def get(id):
+def get(r):
     return False
 

Copied: incubator/nuvem/trunk/nuvem-parallel/nuvem/fbprofile.py (from r1072728, incubator/nuvem/trunk/nuvem-parallel/nuvem/and_.py)
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/fbprofile.py?p2=incubator/nuvem/trunk/nuvem-parallel/nuvem/fbprofile.py&p1=incubator/nuvem/trunk/nuvem-parallel/nuvem/and_.py&r1=1072728&r2=1074928&rev=1074928&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/and_.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/fbprofile.py Sat Feb 26 21:09:25 2011
@@ -15,6 +15,7 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-def get(id, a, b):
-    return a.get(()) and b.get(())
+def get(r, fbid, fb):
+    fid = fbid.get(r)
+    return fb.get((fid,))
 

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/filter_.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/filter_.py?rev=1074928&r1=1074927&r2=1074928&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/filter_.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/filter_.py Sat Feb 26 21:09:25 2011
@@ -15,10 +15,11 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-def get(id, var, cond, l):
+def get(r, item, cond, l):
+    iv = item.get(r)
+
     def cfun(i):
-        var.put(('var',), i)
-        return cond.get(())
+        return cond.get(r + ((iv, i),))
 
-    return tuple(filter(cfun, l.get(())))
+    return tuple(filter(cfun, l.get(r)))
 

Copied: incubator/nuvem/trunk/nuvem-parallel/nuvem/find.py (from r1072728, incubator/nuvem/trunk/nuvem-parallel/nuvem/filter_.py)
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/find.py?p2=incubator/nuvem/trunk/nuvem-parallel/nuvem/find.py&p1=incubator/nuvem/trunk/nuvem-parallel/nuvem/filter_.py&r1=1072728&r2=1074928&rev=1074928&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/filter_.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/find.py Sat Feb 26 21:09:25 2011
@@ -15,10 +15,14 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-def get(id, var, cond, l):
-    def cfun(i):
-        var.put(('var',), i)
-        return cond.get(())
+def get(r, n, l):
+    def lookup(nv, lv):
+        if lv == ():
+            return None
+        a = lv[0]
+        if a[0] == nv:
+            return a[1]
+        return lookup(nv, lv[1:])
 
-    return tuple(filter(cfun, l.get(())))
+    return lookup(n.get(r), l.get(r))
 

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/first.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/first.py?rev=1074928&r1=1074927&r2=1074928&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/first.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/first.py Sat Feb 26 21:09:25 2011
@@ -15,6 +15,6 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-def get(id, l):
-    return l.get(())[0]
+def get(r, l):
+    return l.get(r)[0]
 

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/greater.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/greater.py?rev=1074928&r1=1074927&r2=1074928&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/greater.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/greater.py Sat Feb 26 21:09:25 2011
@@ -15,6 +15,6 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-def get(id, a, b):
-    return a.get(()) > b.get(())
+def get(r, a, b):
+    return a.get(r) > b.get(r)
 

Copied: incubator/nuvem/trunk/nuvem-parallel/nuvem/host.py (from r1072728, incubator/nuvem/trunk/nuvem-parallel/nuvem/text.py)
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/host.py?p2=incubator/nuvem/trunk/nuvem-parallel/nuvem/host.py&p1=incubator/nuvem/trunk/nuvem-parallel/nuvem/text.py&r1=1072728&r2=1074928&rev=1074928&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/text.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/host.py Sat Feb 26 21:09:25 2011
@@ -15,6 +15,6 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-def get(id, prop):
+def get(r, prop):
     return prop.eval()
 

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/if_.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/if_.py?rev=1074928&r1=1074927&r2=1074928&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/if_.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/if_.py Sat Feb 26 21:09:25 2011
@@ -15,9 +15,9 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-def get(id, cond, then, els):
-    if cond.get(()):
-        return then.get(())
+def get(r, cond, then, els):
+    if cond.get(r):
+        return then.get(r)
     else:
-        return els.get(())
+        return els.get(r)
 

Copied: incubator/nuvem/trunk/nuvem-parallel/nuvem/itemnb.py (from r1072728, incubator/nuvem/trunk/nuvem-parallel/nuvem/first.py)
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/itemnb.py?p2=incubator/nuvem/trunk/nuvem-parallel/nuvem/itemnb.py&p1=incubator/nuvem/trunk/nuvem-parallel/nuvem/first.py&r1=1072728&r2=1074928&rev=1074928&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/first.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/itemnb.py Sat Feb 26 21:09:25 2011
@@ -15,6 +15,6 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-def get(id, l):
-    return l.get(())[0]
+def get(r, i, l):
+    return l.get(r)[int(i.get(r))]
 

Copied: incubator/nuvem/trunk/nuvem-parallel/nuvem/join.py (from r1072728, incubator/nuvem/trunk/nuvem-parallel/nuvem/and_.py)
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/join.py?p2=incubator/nuvem/trunk/nuvem-parallel/nuvem/join.py&p1=incubator/nuvem/trunk/nuvem-parallel/nuvem/and_.py&r1=1072728&r2=1074928&rev=1074928&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/and_.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/join.py Sat Feb 26 21:09:25 2011
@@ -15,6 +15,8 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-def get(id, a, b):
-    return a.get(()) and b.get(())
+import string
+
+def get(r, sep, l):
+    return string.join(l.get(r), sep.get(r))
 

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/lesser.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/lesser.py?rev=1074928&r1=1074927&r2=1074928&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/lesser.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/lesser.py Sat Feb 26 21:09:25 2011
@@ -15,6 +15,6 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-def get(id, a, b):
-    return a.get(()) < b.get(())
+def get(r, a, b):
+    return a.get(r) < b.get(r)
 

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/list_.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/list_.py?rev=1074928&r1=1074927&r2=1074928&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/list_.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/list_.py Sat Feb 26 21:09:25 2011
@@ -15,9 +15,9 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-def get(id, first, rest):
-    r = rest.get(())
-    if r is None:
-        return (first.get(()),)
-    return (first.get(()),) + r
+def get(r, first, rest):
+    rst = rest.get(r)
+    if rst is None:
+        return (first.get(r),)
+    return (first.get(r),) + rst
 

Copied: incubator/nuvem/trunk/nuvem-parallel/nuvem/lowercase.py (from r1072728, incubator/nuvem/trunk/nuvem-parallel/nuvem/first.py)
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/lowercase.py?p2=incubator/nuvem/trunk/nuvem-parallel/nuvem/lowercase.py&p1=incubator/nuvem/trunk/nuvem-parallel/nuvem/first.py&r1=1072728&r2=1074928&rev=1074928&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/first.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/lowercase.py Sat Feb 26 21:09:25 2011
@@ -15,6 +15,6 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-def get(id, l):
-    return l.get(())[0]
+def get(r, s):
+    return s.get(r).lower()
 

Copied: incubator/nuvem/trunk/nuvem-parallel/nuvem/map_.py (from r1072728, incubator/nuvem/trunk/nuvem-parallel/nuvem/foreach.py)
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/map_.py?p2=incubator/nuvem/trunk/nuvem-parallel/nuvem/map_.py&p1=incubator/nuvem/trunk/nuvem-parallel/nuvem/foreach.py&r1=1072728&r2=1074928&rev=1074928&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/foreach.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/map_.py Sat Feb 26 21:09:25 2011
@@ -15,10 +15,11 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-def get(id, var, transform, l):
+def get(r, item, transform, l):
+    iv = item.get(r)
+
     def tfun(i):
-        var.put(('var',), i)
-        return transform.get(())
+        return transform.get(r + ((iv, i),))
 
-    return tuple(map(tfun, l.get(())))
+    return tuple(map(tfun, l.get(r)))
 

Copied: incubator/nuvem/trunk/nuvem-parallel/nuvem/multiply.py (from r1072728, incubator/nuvem/trunk/nuvem-parallel/nuvem/and_.py)
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/multiply.py?p2=incubator/nuvem/trunk/nuvem-parallel/nuvem/multiply.py&p1=incubator/nuvem/trunk/nuvem-parallel/nuvem/and_.py&r1=1072728&r2=1074928&rev=1074928&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/and_.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/multiply.py Sat Feb 26 21:09:25 2011
@@ -15,6 +15,6 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-def get(id, a, b):
-    return a.get(()) and b.get(())
+def get(r, a, b):
+    return float(a.get(r)) * float(b.get(r))
 

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/name.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/name.py?rev=1074928&r1=1074927&r2=1074928&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/name.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/name.py Sat Feb 26 21:09:25 2011
@@ -15,6 +15,6 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-def get(id, prop):
+def get(r, prop):
     return "'" + prop.eval()
 

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/not_.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/not_.py?rev=1074928&r1=1074927&r2=1074928&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/not_.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/not_.py Sat Feb 26 21:09:25 2011
@@ -15,6 +15,6 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-def get(id, expr):
-    return not expr.get(())
+def get(r, expr):
+    return not expr.get(r)
 

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/nothing.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/nothing.py?rev=1074928&r1=1074927&r2=1074928&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/nothing.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/nothing.py Sat Feb 26 21:09:25 2011
@@ -15,6 +15,6 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-def get(id):
+def get(r):
     return None
 

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/number.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/number.py?rev=1074928&r1=1074927&r2=1074928&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/number.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/number.py Sat Feb 26 21:09:25 2011
@@ -15,6 +15,6 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-def get(id, prop):
+def get(r, prop):
     return float(prop.eval())
 

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/or_.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/or_.py?rev=1074928&r1=1074927&r2=1074928&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/or_.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/or_.py Sat Feb 26 21:09:25 2011
@@ -15,6 +15,6 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-def get(id, a, b):
-    return a.get(()) or b.get(())
+def get(r, a, b):
+    return a.get(r) or b.get(r)
 

Copied: incubator/nuvem/trunk/nuvem-parallel/nuvem/page.py (from r1072728, incubator/nuvem/trunk/nuvem-parallel/nuvem/first.py)
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/page.py?p2=incubator/nuvem/trunk/nuvem-parallel/nuvem/page.py&p1=incubator/nuvem/trunk/nuvem-parallel/nuvem/first.py&r1=1072728&r2=1074928&rev=1074928&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/first.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/page.py Sat Feb 26 21:09:25 2011
@@ -15,6 +15,6 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-def get(id, l):
-    return l.get(())[0]
+def get(r, content):
+    return content.get(r)
 

Copied: incubator/nuvem/trunk/nuvem-parallel/nuvem/params.py (from r1072728, incubator/nuvem/trunk/nuvem-parallel/nuvem/text.py)
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/params.py?p2=incubator/nuvem/trunk/nuvem-parallel/nuvem/params.py&p1=incubator/nuvem/trunk/nuvem-parallel/nuvem/text.py&r1=1072728&r2=1074928&rev=1074928&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/text.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/params.py Sat Feb 26 21:09:25 2011
@@ -15,6 +15,6 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-def get(id, prop):
+def get(r, prop):
     return prop.eval()
 

Copied: incubator/nuvem/trunk/nuvem-parallel/nuvem/path.py (from r1072728, incubator/nuvem/trunk/nuvem-parallel/nuvem/text.py)
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/path.py?p2=incubator/nuvem/trunk/nuvem-parallel/nuvem/path.py&p1=incubator/nuvem/trunk/nuvem-parallel/nuvem/text.py&r1=1072728&r2=1074928&rev=1074928&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/text.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/path.py Sat Feb 26 21:09:25 2011
@@ -15,6 +15,6 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-def get(id, prop):
+def get(r, prop):
     return prop.eval()
 

Copied: incubator/nuvem/trunk/nuvem-parallel/nuvem/range_.py (from r1072728, incubator/nuvem/trunk/nuvem-parallel/nuvem/and_.py)
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/range_.py?p2=incubator/nuvem/trunk/nuvem-parallel/nuvem/range_.py&p1=incubator/nuvem/trunk/nuvem-parallel/nuvem/and_.py&r1=1072728&r2=1074928&rev=1074928&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/and_.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/range_.py Sat Feb 26 21:09:25 2011
@@ -15,6 +15,6 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-def get(id, a, b):
-    return a.get(()) and b.get(())
+def get(r, a, b):
+    return tuple(range(int(a.get(r)), int(b.get(r))))
 

Copied: incubator/nuvem/trunk/nuvem-parallel/nuvem/realm.py (from r1072728, incubator/nuvem/trunk/nuvem-parallel/nuvem/text.py)
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/realm.py?p2=incubator/nuvem/trunk/nuvem-parallel/nuvem/realm.py&p1=incubator/nuvem/trunk/nuvem-parallel/nuvem/text.py&r1=1072728&r2=1074928&rev=1074928&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/text.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/realm.py Sat Feb 26 21:09:25 2011
@@ -15,6 +15,6 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-def get(id, prop):
+def get(r, prop):
     return prop.eval()
 

Copied: incubator/nuvem/trunk/nuvem-parallel/nuvem/reduce_.py (from r1072728, incubator/nuvem/trunk/nuvem-parallel/nuvem/filter_.py)
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/reduce_.py?p2=incubator/nuvem/trunk/nuvem-parallel/nuvem/reduce_.py&p1=incubator/nuvem/trunk/nuvem-parallel/nuvem/filter_.py&r1=1072728&r2=1074928&rev=1074928&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/filter_.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/reduce_.py Sat Feb 26 21:09:25 2011
@@ -15,10 +15,12 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-def get(id, var, cond, l):
-    def cfun(i):
-        var.put(('var',), i)
-        return cond.get(())
+def get(r, item, accum, transform, l):
+    iv = item.get(r)
+    av = accum.get(r)
 
-    return tuple(filter(cfun, l.get(())))
+    def tfun(a, i):
+        return transform.get(r + ((av, a), (iv, i)))
+
+    return reduce(tfun, l.get(r))
 

Copied: incubator/nuvem/trunk/nuvem-parallel/nuvem/replace.py (from r1072728, incubator/nuvem/trunk/nuvem-parallel/nuvem/and_.py)
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/replace.py?p2=incubator/nuvem/trunk/nuvem-parallel/nuvem/replace.py&p1=incubator/nuvem/trunk/nuvem-parallel/nuvem/and_.py&r1=1072728&r2=1074928&rev=1074928&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/and_.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/replace.py Sat Feb 26 21:09:25 2011
@@ -15,6 +15,6 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-def get(id, a, b):
-    return a.get(()) and b.get(())
+def get(r, fr, to, s):
+    return s.get(r).replace(fr.get(r), to.get(r))
 

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/rest.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/rest.py?rev=1074928&r1=1074927&r2=1074928&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/rest.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/rest.py Sat Feb 26 21:09:25 2011
@@ -15,6 +15,6 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-def get(id, l):
-    return l.get(())[1:]
+def get(r, l):
+    return l.get(r)[1:]
 

Copied: incubator/nuvem/trunk/nuvem-parallel/nuvem/reverse.py (from r1072728, incubator/nuvem/trunk/nuvem-parallel/nuvem/and_.py)
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/reverse.py?p2=incubator/nuvem/trunk/nuvem-parallel/nuvem/reverse.py&p1=incubator/nuvem/trunk/nuvem-parallel/nuvem/and_.py&r1=1072728&r2=1074928&rev=1074928&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/and_.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/reverse.py Sat Feb 26 21:09:25 2011
@@ -15,6 +15,8 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-def get(id, a, b):
-    return a.get(()) and b.get(())
+def get(r, l):
+    rl = list(l.get(r))
+    rl.reverse()
+    return tuple(rl)
 

Copied: incubator/nuvem/trunk/nuvem-parallel/nuvem/split.py (from r1072728, incubator/nuvem/trunk/nuvem-parallel/nuvem/and_.py)
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/split.py?p2=incubator/nuvem/trunk/nuvem-parallel/nuvem/split.py&p1=incubator/nuvem/trunk/nuvem-parallel/nuvem/and_.py&r1=1072728&r2=1074928&rev=1074928&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/and_.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/split.py Sat Feb 26 21:09:25 2011
@@ -15,6 +15,6 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-def get(id, a, b):
-    return a.get(()) and b.get(())
+def get(r, sep, s):
+    return tuple(s.get(r).split(sep.get(r)))
 

Copied: incubator/nuvem/trunk/nuvem-parallel/nuvem/subtract.py (from r1072728, incubator/nuvem/trunk/nuvem-parallel/nuvem/and_.py)
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/subtract.py?p2=incubator/nuvem/trunk/nuvem-parallel/nuvem/subtract.py&p1=incubator/nuvem/trunk/nuvem-parallel/nuvem/and_.py&r1=1072728&r2=1074928&rev=1074928&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/and_.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/subtract.py Sat Feb 26 21:09:25 2011
@@ -15,6 +15,6 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-def get(id, a, b):
-    return a.get(()) and b.get(())
+def get(r, a, b):
+    return float(a.get(r)) - float(b.get(r))
 

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/text.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/text.py?rev=1074928&r1=1074927&r2=1074928&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/text.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/text.py Sat Feb 26 21:09:25 2011
@@ -15,6 +15,6 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-def get(id, prop):
+def get(r, prop):
     return prop.eval()
 

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/true_.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/true_.py?rev=1074928&r1=1074927&r2=1074928&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/true_.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/true_.py Sat Feb 26 21:09:25 2011
@@ -15,6 +15,6 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-def get(id):
+def get(r):
     return True
 

Copied: incubator/nuvem/trunk/nuvem-parallel/nuvem/twprofile.py (from r1072728, incubator/nuvem/trunk/nuvem-parallel/nuvem/and_.py)
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/twprofile.py?p2=incubator/nuvem/trunk/nuvem-parallel/nuvem/twprofile.py&p1=incubator/nuvem/trunk/nuvem-parallel/nuvem/and_.py&r1=1072728&r2=1074928&rev=1074928&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/and_.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/twprofile.py Sat Feb 26 21:09:25 2011
@@ -15,6 +15,7 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-def get(id, a, b):
-    return a.get(()) and b.get(())
+def get(r, twid, tw):
+    tid = twid.get(r)
+    return tw.get((("'screen_name", tid),))
 

Copied: incubator/nuvem/trunk/nuvem-parallel/nuvem/uppercase.py (from r1072728, incubator/nuvem/trunk/nuvem-parallel/nuvem/first.py)
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/uppercase.py?p2=incubator/nuvem/trunk/nuvem-parallel/nuvem/uppercase.py&p1=incubator/nuvem/trunk/nuvem-parallel/nuvem/first.py&r1=1072728&r2=1074928&rev=1074928&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/first.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/uppercase.py Sat Feb 26 21:09:25 2011
@@ -15,6 +15,6 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-def get(id, l):
-    return l.get(())[0]
+def get(r, s):
+    return s.get(r).upper()
 

Copied: incubator/nuvem/trunk/nuvem-parallel/nuvem/user.py (from r1072728, incubator/nuvem/trunk/nuvem-parallel/nuvem/text.py)
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/user.py?p2=incubator/nuvem/trunk/nuvem-parallel/nuvem/user.py&p1=incubator/nuvem/trunk/nuvem-parallel/nuvem/text.py&r1=1072728&r2=1074928&rev=1074928&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/text.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/user.py Sat Feb 26 21:09:25 2011
@@ -15,6 +15,6 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-def get(id, prop):
+def get(r, prop):
     return prop.eval()
 

Copied: incubator/nuvem/trunk/nuvem-parallel/nuvem/valueof.py (from r1072728, incubator/nuvem/trunk/nuvem-parallel/nuvem/filter_.py)
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/valueof.py?p2=incubator/nuvem/trunk/nuvem-parallel/nuvem/valueof.py&p1=incubator/nuvem/trunk/nuvem-parallel/nuvem/filter_.py&r1=1072728&r2=1074928&rev=1074928&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/filter_.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/valueof.py Sat Feb 26 21:09:25 2011
@@ -15,10 +15,21 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-def get(id, var, cond, l):
-    def cfun(i):
-        var.put(('var',), i)
-        return cond.get(())
+def get(r, name):
+    def isList(v):
+        if getattr(v, '__iter__', False) == False:
+            return False
+        if isinstance(v, basestring) or isinstance(v, dict):
+            return False
+        return True
 
-    return tuple(filter(cfun, l.get(())))
+    def lookup(n, r):
+        if r == ():
+            return None
+        a = r[0]
+        if isList(a) and a[0] == n:
+            return a[1]
+        return lookup(n, r[1:])
+
+    return lookup("'" + name.eval(), r)
 

Modified: incubator/nuvem/trunk/nuvem-parallel/test.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/test.py?rev=1074928&r1=1074927&r2=1074928&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/test.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/test.py Sat Feb 26 21:09:25 2011
@@ -29,7 +29,7 @@ from nuvem import number
 from nuvem import text
 from nuvem import name
 from nuvem import nothing
-from nuvem import pair
+from nuvem import assoc
 from nuvem import if_
 from nuvem import and_
 from nuvem import or_
@@ -41,8 +41,31 @@ from nuvem import list_
 from nuvem import empty
 from nuvem import first
 from nuvem import rest
-from nuvem import foreach
+from nuvem import append
+from nuvem import itemnb
+from nuvem import find
+from nuvem import reverse
+from nuvem import range_
+from nuvem import map_
+from nuvem import valueof
 from nuvem import filter_
+from nuvem import reduce_
+from nuvem import add
+from nuvem import subtract
+from nuvem import multiply
+from nuvem import divide
+from nuvem import host
+from nuvem import path
+from nuvem import params
+from nuvem import user
+from nuvem import realm
+from nuvem import email
+from nuvem import contains
+from nuvem import split
+from nuvem import join
+from nuvem import replace
+from nuvem import lowercase
+from nuvem import uppercase
 
 def testValues():
     assert true_.get(()) == True
@@ -51,41 +74,78 @@ def testValues():
     assert number.get((), mkprop('value', lambda: 1)) == 1
     assert text.get((), mkprop('value', lambda: 'abc')) == 'abc'
     assert name.get((), mkprop('value', lambda: 'abc')) == "'abc"
-    assert pair.get((), mkref('a', lambda id: 'abc'), mkref('b', lambda id: 'def')) == ('abc', 'def')
+    assert assoc.get((), mkref('a', lambda r: 'abc'), mkref('b', lambda r: 'def')) == ('abc', 'def')
+    return True
+
+def testLogic():
+    assert if_.get((), mkref('cond', lambda r: True), mkref('then', lambda r: 'abc'), mkref('els', lambda r: 'def')) == 'abc'
+    assert if_.get((), mkref('cond', lambda r: False), mkref('then', lambda r: 'abc'), mkref('els', lambda r: 'def')) == 'def'
+    assert and_.get((), mkref('a', lambda r: False), mkref('b', lambda r: True)) == False
+    assert and_.get((), mkref('a', lambda r: True), mkref('b', lambda r: True)) == True
+    assert or_.get((), mkref('a', lambda r: False), mkref('b', lambda r: False)) == False
+    assert or_.get((), mkref('a', lambda r: False), mkref('b', lambda r: True)) == True
+    assert not_.get((), mkref('expr', lambda r: False)) == True
+    assert not_.get((), mkref('expr', lambda r: True)) == False
+    assert equals.get((), mkref('a', lambda r: 'abc'), mkref('b', lambda r: 'abc')) == True
+    assert equals.get((), mkref('a', lambda r: 'abc'), mkref('b', lambda r: 'def')) == False
+    assert lesser.get((), mkref('a', lambda r: 'abc'), mkref('b', lambda r: 'abc')) == False
+    assert lesser.get((), mkref('a', lambda r: 'abc'), mkref('b', lambda r: 'def')) == True
+    assert greater.get((), mkref('a', lambda r: 'abc'), mkref('b', lambda r: 'abc')) == False
+    assert greater.get((), mkref('a', lambda r: 'def'), mkref('b', lambda r: 'abc')) == True
+    return True
 
-    assert if_.get((), mkref('cond', lambda id: True), mkref('then', lambda id: 'abc'), mkref('els', lambda id: 'def')) == 'abc'
-    assert if_.get((), mkref('cond', lambda id: False), mkref('then', lambda id: 'abc'), mkref('els', lambda id: 'def')) == 'def'
-    assert and_.get((), mkref('a', lambda id: False), mkref('b', lambda id: True)) == False
-    assert and_.get((), mkref('a', lambda id: True), mkref('b', lambda id: True)) == True
-    assert or_.get((), mkref('a', lambda id: False), mkref('b', lambda id: False)) == False
-    assert or_.get((), mkref('a', lambda id: False), mkref('b', lambda id: True)) == True
-    assert not_.get((), mkref('expr', lambda id: False)) == True
-    assert not_.get((), mkref('expr', lambda id: True)) == False
-    assert equals.get((), mkref('a', lambda id: 'abc'), mkref('b', lambda id: 'abc')) == True
-    assert equals.get((), mkref('a', lambda id: 'abc'), mkref('b', lambda id: 'def')) == False
-    assert lesser.get((), mkref('a', lambda id: 'abc'), mkref('b', lambda id: 'abc')) == False
-    assert lesser.get((), mkref('a', lambda id: 'abc'), mkref('b', lambda id: 'def')) == True
-    assert greater.get((), mkref('a', lambda id: 'abc'), mkref('b', lambda id: 'abc')) == False
-    assert greater.get((), mkref('a', lambda id: 'def'), mkref('b', lambda id: 'abc')) == True
-
-    assert list_.get((), mkref('first', lambda id: 'abc'), mkref('rest', lambda id: None)) == ('abc',)
-    assert list_.get((), mkref('first', lambda id: 'abc'), mkref('rest', lambda id: ())) == ('abc',)
-    assert list_.get((), mkref('first', lambda id: 'abc'), mkref('rest', lambda id: ('def',))) == ('abc','def')
-    assert list_.get((), mkref('first', lambda id: 'abc'), mkref('rest', lambda id: ('def', 'ghi'))) == ('abc','def', 'ghi')
+def testLists():
+    assert list_.get((), mkref('first', lambda r: 'abc'), mkref('rest', lambda r: None)) == ('abc',)
+    assert list_.get((), mkref('first', lambda r: 'abc'), mkref('rest', lambda r: ())) == ('abc',)
+    assert list_.get((), mkref('first', lambda r: 'abc'), mkref('rest', lambda r: ('def',))) == ('abc', 'def')
+    assert list_.get((), mkref('first', lambda r: 'abc'), mkref('rest', lambda r: ('def', 'ghi'))) == ('abc', 'def', 'ghi')
     assert empty.get(()) == ()
-    assert first.get((), mkref('l', lambda id: ('abc', 'def'))) == 'abc'
-    assert rest.get((), mkref('l', lambda id: ('abc', 'def', 'ghi'))) == ('def', 'ghi')
-    assert rest.get((), mkref('l', lambda id: ('abc',))) == ()
+    assert first.get((), mkref('l', lambda r: ('abc', 'def'))) == 'abc'
+    assert rest.get((), mkref('l', lambda r: ('abc', 'def', 'ghi'))) == ('def', 'ghi')
+    assert rest.get((), mkref('l', lambda r: ('abc',))) == ()
+    assert append.get((), mkref('l', lambda r: ('abc', 'def')), mkref('b', lambda r: ('ghi',))) == ('abc', 'def', 'ghi')
+    assert itemnb.get((), mkref('i', lambda r: 1), mkref('l', lambda r: ('abc', 'def', 'ghi'))) == 'def'
+    assert find.get((), mkref('n', lambda r: "'d"), mkref('l', lambda r: (("'a", 'abc'), ("'d", 'def'), ("'g", 'ghi')))) == 'def'
+    assert reverse.get((), mkref('l', lambda r: ('abc', 'def', 'ghi'))) == ('ghi', 'def', 'abc')
+    assert range_.get((), mkref('a', lambda r: '1'), mkref('b', lambda r: '4')) == (1, 2, 3)
+
+    assert map_.get((), mkref('item', lambda r: "'i"), mkref('transform', lambda r: valueof.get(r, mkprop('name', lambda: 'i')) * 2), mkref('list', lambda r: (1, 2, 3))) == (2, 4, 6)
+    assert filter_.get((), mkref('item', lambda r: "'i"), mkref('cond', lambda r: valueof.get(r, mkprop('name', lambda: 'i')) % 2 == 0), mkref('list', lambda r: (1, 2, 3, 4))) == (2, 4)
+    assert reduce_.get((), mkref('item', lambda r: "'i"), mkref('accum', lambda r: "'a"), mkref('transform', lambda r: valueof.get(r, mkprop('name', lambda: 'a')) + valueof.get(r, mkprop('name', lambda: 'i'))), mkref('list', lambda r: (1, 2, 3, 4))) == 10
+    return True
 
-    foreachenv = mkenv('foreach')
-    assert foreach.get((), foreachenv, mkref('transform', lambda id: foreachenv.get(()) * 2), mkref('list', lambda id: (1, 2, 3))) == (2, 4, 6)
+def testMath():
+    assert add.get((), mkref('a', lambda r: 3), mkref('b', lambda r: 2)) == 5
+    assert subtract.get((), mkref('a', lambda r: 3), mkref('b', lambda r: 2)) == 1
+    assert multiply.get((), mkref('a', lambda r: 2), mkref('b', lambda r: 3)) == 6
+    assert divide.get((), mkref('a', lambda r: 3), mkref('b', lambda r: 2)) == 1.5
+    return True
+
+def testURL():
+    assert host.get((), mkprop('host', lambda: 'localhost')) == 'localhost'
+    assert path.get((), mkprop('path', lambda: ('abc', 'def'))) == ('abc', 'def')
+    assert params.get((), mkprop('params', lambda: (("'a", 'abc'), ("'d", 'def')))) == (("'a", 'abc'), ("'d", 'def'))
+    assert user.get((), mkprop('user', lambda: 'joe')) == 'joe'
+    assert realm.get((), mkprop('realm', lambda: 'localhost')) == 'localhost'
+    assert email.get((), mkprop('email', lambda: 'joe@localhost')) == 'joe@localhost'
+    return True
 
-    filterenv = mkenv('filter')
-    assert filter_.get((), filterenv, mkref('transform', lambda id: filterenv.get(()) % 2 == 0), mkref('list', lambda id: (1, 2, 3, 4))) == (2, 4)
+def testText():
+    assert contains.get((), mkref('sub', lambda r: 'bc'), mkref('s', lambda r: 'abcd')) == True
+    assert split.get((), mkref('sep', lambda r: 'x'), mkref('s', lambda r: 'abcxdef')) == ('abc', 'def')
+    assert join.get((), mkref('sep', lambda r: 'x'), mkref('s', lambda r: ('abc', 'def'))) == 'abcxdef'
+    assert replace.get((), mkref('from', lambda r: 'x'), mkref('to', lambda r: 'y'), mkref('s', lambda r: 'abcxdefxghi')) == 'abcydefyghi'
+    assert lowercase.get((), mkref('s', lambda r: 'ABC')) == 'abc'
+    assert uppercase.get((), mkref('s', lambda r: 'abc')) == 'ABC'
     return True
 
 if __name__ == '__main__':
     print 'Testing...'
     testValues()
+    testLogic()
+    testLists()
+    testMath()
+    testURL()
+    testText()
     print 'OK'
 



Mime
View raw message