summaryrefslogtreecommitdiffstats
path: root/sca-cpp/trunk/samples
diff options
context:
space:
mode:
Diffstat (limited to 'sca-cpp/trunk/samples')
-rw-r--r--sca-cpp/trunk/samples/store-constdb/shopping-cart.scm10
-rw-r--r--sca-cpp/trunk/samples/store-cpp/htdocs/test/items-result.txt24
-rw-r--r--sca-cpp/trunk/samples/store-python/htdocs/test/items-result.txt24
-rw-r--r--sca-cpp/trunk/samples/store-scheme/shopping-cart.scm10
-rw-r--r--sca-cpp/trunk/samples/store-sql/shopping-cart.scm10
5 files changed, 17 insertions, 61 deletions
diff --git a/sca-cpp/trunk/samples/store-constdb/shopping-cart.scm b/sca-cpp/trunk/samples/store-constdb/shopping-cart.scm
index e653f1e33c..3dff67e99c 100644
--- a/sca-cpp/trunk/samples/store-constdb/shopping-cart.scm
+++ b/sca-cpp/trunk/samples/store-constdb/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))))
)
diff --git a/sca-cpp/trunk/samples/store-cpp/htdocs/test/items-result.txt b/sca-cpp/trunk/samples/store-cpp/htdocs/test/items-result.txt
index 0b456ea9d0..56f87d2778 100644
--- a/sca-cpp/trunk/samples/store-cpp/htdocs/test/items-result.txt
+++ b/sca-cpp/trunk/samples/store-cpp/htdocs/test/items-result.txt
@@ -1,23 +1 @@
-{
- "id": 1,
- "result": [
- {
- "name": "Apple",
- "currencyCode": "USD",
- "currencySymbol": "$",
- "price": 2.99
- },
- {
- "name": "Orange",
- "currencyCode": "USD",
- "currencySymbol": "$",
- "price": 3.55
- },
- {
- "name": "Pear",
- "currencyCode": "USD",
- "currencySymbol": "$",
- "price": 1.55
- }
- ]
-} \ No newline at end of file
+{"id":1,"result":[{"name":"Apple","currencyCode":"USD","currencySymbol":"$","price":2.99},{"name":"Orange","currencyCode":"USD","currencySymbol":"$","price":3.55},{"name":"Pear","currencyCode":"USD","currencySymbol":"$","price":1.55}]} \ No newline at end of file
diff --git a/sca-cpp/trunk/samples/store-python/htdocs/test/items-result.txt b/sca-cpp/trunk/samples/store-python/htdocs/test/items-result.txt
index d6aaf4d44a..788b7cdf89 100644
--- a/sca-cpp/trunk/samples/store-python/htdocs/test/items-result.txt
+++ b/sca-cpp/trunk/samples/store-python/htdocs/test/items-result.txt
@@ -1,23 +1 @@
-{
- "id": 1,
- "result": [
- {
- "name": "Mango",
- "currencyCode": "USD",
- "currencySymbol": "$",
- "price": 2.99
- },
- {
- "name": "Passion",
- "currencyCode": "USD",
- "currencySymbol": "$",
- "price": 3.55
- },
- {
- "name": "Kiwi",
- "currencyCode": "USD",
- "currencySymbol": "$",
- "price": 1.55
- }
- ]
-} \ No newline at end of file
+{"id":1,"result":[{"name":"Mango","currencyCode":"USD","currencySymbol":"$","price":2.99},{"name":"Passion","currencyCode":"USD","currencySymbol":"$","price":3.55},{"name":"Kiwi","currencyCode":"USD","currencySymbol":"$","price":1.55}]} \ No newline at end of file
diff --git a/sca-cpp/trunk/samples/store-scheme/shopping-cart.scm b/sca-cpp/trunk/samples/store-scheme/shopping-cart.scm
index e653f1e33c..3dff67e99c 100644
--- a/sca-cpp/trunk/samples/store-scheme/shopping-cart.scm
+++ b/sca-cpp/trunk/samples/store-scheme/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))))
)
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))))
)