summaryrefslogtreecommitdiff
path: root/modules/language/python/list.scm
diff options
context:
space:
mode:
authorStefan Israelsson Tampe <stefan.itampe@gmail.com>2017-12-01 17:24:12 +0100
committerStefan Israelsson Tampe <stefan.itampe@gmail.com>2017-12-01 17:24:12 +0100
commitd4f5255498d07b424ba5d6b8535aedc3ec40808a (patch)
tree5075076b3beeec6f1c59e428d8b323bcf749ab65 /modules/language/python/list.scm
parente7bf554e568e74e1211186fe29b921a97893c60b (diff)
string formatter library
Diffstat (limited to 'modules/language/python/list.scm')
-rw-r--r--modules/language/python/list.scm4
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/language/python/list.scm b/modules/language/python/list.scm
index 34c9ba0..0131328 100644
--- a/modules/language/python/list.scm
+++ b/modules/language/python/list.scm
@@ -727,6 +727,10 @@
(defpair (len l) (length l))
+(define-method (len x)
+ (if (null? x)
+ 0
+ (error "not a suitable lengthof")))
(define-method (len (v <vector>)) (vector-length v))
(define-method (len (s <string>)) (string-length s))
(define-method (len (o <py-list>)) (slot-ref o 'n))