From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Bavier Subject: Re: Adding wc to Bournish Date: Fri, 27 May 2016 08:37:49 -0500 Message-ID: References: <20160524184720.GA27449@debian-netbook> <20160526192755.GB28047@debian-netbook> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45919) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6Hxh-0001yH-8Q for guix-devel@gnu.org; Fri, 27 May 2016 09:38:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b6Hxe-0003Po-3e for guix-devel@gnu.org; Fri, 27 May 2016 09:38:01 -0400 In-Reply-To: <20160526192755.GB28047@debian-netbook> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Efraim Flashner Cc: guix-devel@gnu.org 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 `# (((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