summaryrefslogtreecommitdiff
path: root/modules/language/python/list.scm
diff options
context:
space:
mode:
authorStefan Israelsson Tampe <stefan.itampe@gmail.com>2018-03-27 16:19:00 +0200
committerStefan Israelsson Tampe <stefan.itampe@gmail.com>2018-03-27 16:19:00 +0200
commit944fc50b8b36455b9749ad6b60f3020d466f901c (patch)
treeabbbfdda0c84a10609a5ddda5d3940733db75f7e /modules/language/python/list.scm
parent1c4e6def8285e0740461b732c78c74ed3345f524 (diff)
large part of functools compiles
Diffstat (limited to 'modules/language/python/list.scm')
-rw-r--r--modules/language/python/list.scm8
1 files changed, 8 insertions, 0 deletions
diff --git a/modules/language/python/list.scm b/modules/language/python/list.scm
index 782b5a9..ddb4be5 100644
--- a/modules/language/python/list.scm
+++ b/modules/language/python/list.scm
@@ -9,6 +9,7 @@
#:use-module (language python yield)
#:use-module (language python for)
#:use-module (language python try)
+ #:use-module (language python bool)
#:use-module (language python exceptions)
#:use-module (language python persist)
#:export (to-list to-pylist <py-list> py-list
@@ -114,6 +115,13 @@
(define-method (to-pylist (o <string>))
(to-pylist (string->list o)))
+(define-method (bool (o <py-list>))
+ (not (= (len o) 0)))
+(define-method (bool (o <vector>))
+ (not (= (len o) 0)))
+(define-method (bool (o <string>))
+ (not (= (len o) 0)))
+
(define-method (to-pylist l)
(if (null? l)
(let ((o (make <py-list>)))