From 157ca678dee75e7881a0198425d0c8328f0bee04 Mon Sep 17 00:00:00 2001 From: jsdelfino Date: Thu, 3 Jan 2013 07:41:02 +0000 Subject: Improve handling of nested lists, trees, null and floating point values. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1428191 13f79535-47bb-0310-9956-ffa450edef68 --- sca-cpp/trunk/samples/store-sql/shopping-cart.scm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'sca-cpp/trunk/samples/store-sql/shopping-cart.scm') diff --git a/sca-cpp/trunk/samples/store-sql/shopping-cart.scm b/sca-cpp/trunk/samples/store-sql/shopping-cart.scm index e653f1e33c..3dff67e99c 100644 --- a/sca-cpp/trunk/samples/store-sql/shopping-cart.scm +++ b/sca-cpp/trunk/samples/store-sql/shopping-cart.scm @@ -23,7 +23,7 @@ ; Return an empty cart if not found (define (getcart id cache) (define cart (cache "get" (list id))) - (if (nul cart) + (if (null? cart) (list) cart) ) @@ -39,7 +39,7 @@ ; Find an item in the cart (define (find id cart) - (if (nul cart) + (if (null? cart) (list (list 'entry (list 'title "Item") (list 'id "0"))) (if (= id (cadr (caddr (car cart)))) (list (car cart)) @@ -48,7 +48,7 @@ ; Get items from the cart (define (get id cache) - (if (nul id) + (if (null? id) (list (append (list 'feed (list 'title "Your Cart") (list 'id cartId)) (getcart cartId cache))) (find (car id) (getcart cartId cache)) ) @@ -56,7 +56,7 @@ ; Delete items from the cart (define (delete id cache) - (if (nul id) + (if (null? id) (cache "delete" (list cartId)) true ) @@ -69,7 +69,7 @@ ; Sum the prices of a list of items (define (sum items) - (if (nul items) + (if (null? items) 0 (+ (price (car items)) (sum (cdr items)))) ) -- cgit v1.2.3