From 89ae1daa277f37e1bd018287534cd730d4b35eba Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Tue, 4 Jun 2019 13:37:40 +0200 Subject: persist: Fix indentation throughout. * modules/language/python/persist.scm: Fix indentation. --- modules/language/python/persist.scm | 106 ++++++++++++++++++------------------ 1 file changed, 53 insertions(+), 53 deletions(-) (limited to 'modules') diff --git a/modules/language/python/persist.scm b/modules/language/python/persist.scm index 1835201..dc1e409 100644 --- a/modules/language/python/persist.scm +++ b/modules/language/python/persist.scm @@ -16,10 +16,10 @@ (vhash-fold (lambda (k v s) (if (hash-ref t k) - s - (begin - (hash-set! t k #t) - (cons (cons k v) s)))) + s + (begin + (hash-set! t k #t) + (cons (cons k v) s)))) '() v))) (define-method (pcopyable? (o

)) #t) @@ -27,24 +27,24 @@ (define (cp o) (match (red o) - ((#:reduce mk f) - (let ((oo (mk))) - (for-each (lambda (x) (apply (car x) oo (cdr x))) f) - oo)))) + ((#:reduce mk f) + (let ((oo (mk))) + (for-each (lambda (x) (apply (car x) oo (cdr x))) f) + oo)))) (define (red o) (fluid-set! first #t) (list #:reduce - (let ((cl (class-of o))) - (lambda () (make cl))) - (reduce o))) + (let ((cl (class-of o))) + (lambda () (make cl))) + (reduce o))) (define-method (pcopy (o

)) (list #:obj - (aif it (ref o '__copy__) - (it) - (cp o)))) + (aif it (ref o '__copy__) + (it) + (cp o)))) (define-method (deep-pcopy (o

) p?) (aif it (and p? (ref o '__deepcopy__)) @@ -56,23 +56,23 @@ (define-method (reduce (o

)) (if (fluid-ref first) (begin - (fluid-set! first #f) - (cons - (aif it (ref o '__reduce__) - (it) - (cons - (lambda (o args) - (let ((h (make-hash-table))) - (slot-set! o 'h h) - (for-each - (lambda (x) (hash-set! h (car x) (cdr x))) - args))) - (list - (hash-fold - (lambda (k v s) (cons (cons k v) s)) - '() - (slot-ref o 'h))))) - (next-method))) + (fluid-set! first #f) + (cons + (aif it (ref o '__reduce__) + (it) + (cons + (lambda (o args) + (let ((h (make-hash-table))) + (slot-set! o 'h h) + (for-each + (lambda (x) (hash-set! h (car x) (cdr x))) + args))) + (list + (hash-fold + (lambda (k v s) (cons (cons k v) s)) + '() + (slot-ref o 'h))))) + (next-method))) (next-method))) (define (fold f s l) @@ -83,20 +83,20 @@ (define-method (reduce (o )) (if (fluid-ref first) (begin - (fluid-set! first #f) - (cons* - (cons - (lambda (o n args) - (slot-set! o 'size n) - (slot-set! o 'n n) - (let ((h - (fold - (lambda (k v s) (vhash-assoc k v s)) - vlist-null - args))) - (slot-set! o 'h h))) - (list (slot-ref o 'n) (vhash->assoc (slot-ref o 'h)))) - (next-method))) + (fluid-set! first #f) + (cons* + (cons + (lambda (o n args) + (slot-set! o 'size n) + (slot-set! o 'n n) + (let ((h + (fold + (lambda (k v s) (vhash-assoc k v s)) + vlist-null + args))) + (slot-set! o 'h h))) + (list (slot-ref o 'n) (vhash->assoc (slot-ref o 'h)))) + (next-method))) (next-method))) (define-syntax cpit @@ -104,11 +104,11 @@ (syntax-case x () ((_ (o lam a)) #'(begin - (define-method (pcopyable? (o ) ) #t) - (define-method (deep-pcopyable? (o ) ) #t) - (define-method (pcopy (o ) ) (cp o)) - (define-method (deep-pcopy (o ) p?) (red o)) - (define-method (reduce (o ) ) - (cons* - (cons lam a) - (next-method)))))))) + (define-method (pcopyable? (o ) ) #t) + (define-method (deep-pcopyable? (o ) ) #t) + (define-method (pcopy (o ) ) (cp o)) + (define-method (deep-pcopy (o ) p?) (red o)) + (define-method (reduce (o ) ) + (cons* + (cons lam a) + (next-method)))))))) -- cgit v1.2.3