guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Adding wc to Bournish


From: Eric Bavier
Subject: Re: Adding wc to Bournish
Date: Fri, 27 May 2016 08:37:49 -0500
User-agent: Roundcube Webmail/1.0.6

On 2016-05-26 14:27, Efraim Flashner wrote:
Here's where I'm currently at with 'wc'. Currently I'm getting an error
about having the wrong number of arguments for lambda (I assume)
[...]
+(define (wc-command file)
+  ((lambda (lines words chars) ; lambda doesn't like 3 variables
+     (format #t "~a ~a ~a ~a~%" lines words chars file))
+   (call-with-input-file file lines+chars)))
[...]

;;; /home/efraim/workspace/guix/guix/build/bournish.scm:143:2: warning:
wrong number of arguments to `#<tree-il (lambda () (lambda-case (((lines
words chars) #f #f #f () (lines-24244 words-24245 chars-24246)) (apply
(toplevel format) (const #t) (const "~a ~a ~a ~a~%") (lexical lines
lines-24244) (lexical words words-24245) (lexical chars chars-24246)
(lexical file file-24242)))))>'

I think you might just be missing a 'call-with-values':

(define (wc-command file)
  (call-with-values
    (call-with-input-file file lines+chars)
    (lambda (lines words chars) ...)))

--
`~Eric



reply via email to

[Prev in Thread] Current Thread [Next in Thread]