diff options
author | Stefan Israelsson Tampe <stefan.itampe@gmail.com> | 2018-03-27 16:19:00 +0200 |
---|---|---|
committer | Stefan Israelsson Tampe <stefan.itampe@gmail.com> | 2018-03-27 16:19:00 +0200 |
commit | 944fc50b8b36455b9749ad6b60f3020d466f901c (patch) | |
tree | abbbfdda0c84a10609a5ddda5d3940733db75f7e /modules/language/python/list.scm | |
parent | 1c4e6def8285e0740461b732c78c74ed3345f524 (diff) |
large part of functools compiles
Diffstat (limited to 'modules/language/python/list.scm')
-rw-r--r-- | modules/language/python/list.scm | 8 |
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>))) |