unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eric Bavier <ericbavier@openmailbox.org>
To: Efraim Flashner <efraim@flashner.co.il>
Cc: guix-devel@gnu.org
Subject: Re: Adding wc to Bournish
Date: Fri, 27 May 2016 08:37:49 -0500	[thread overview]
Message-ID: <f6f67038e99bb8f93267ff07f9a585d8@openmailbox.org> (raw)
In-Reply-To: <20160526192755.GB28047@debian-netbook>

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	other threads:[~2016-05-27 13:38 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-24 18:47 Adding wc to Bournish Efraim Flashner
2016-05-25  9:03 ` Ricardo Wurmus
2016-05-25  9:43   ` Efraim Flashner
2016-05-25  9:26 ` Ricardo Wurmus
2016-05-25 10:05   ` Efraim Flashner
2016-05-26  8:46 ` Ludovic Courtès
2016-05-26 17:50   ` Efraim Flashner
2016-05-26 19:27 ` Efraim Flashner
2016-05-27 13:37   ` Eric Bavier [this message]
2016-05-27 15:28     ` Taylan Ulrich Bayırlı/Kammer
2016-05-27 15:32       ` Thompson, David
2016-06-05 12:40 ` Efraim Flashner
2016-06-05 20:37   ` Ludovic Courtès
2016-06-07  7:41     ` Efraim Flashner
2016-06-08 15:43       ` Ludovic Courtès
2016-06-14  9:27         ` Efraim Flashner
2016-06-14  9:57           ` Ricardo Wurmus
2016-06-14 10:20             ` Efraim Flashner
2016-06-14 10:50               ` Efraim Flashner
2016-06-14 11:08                 ` Ricardo Wurmus
2016-06-15 13:56                 ` Ludovic Courtès
2016-06-15 20:28                   ` Efraim Flashner
2016-06-23  8:34                     ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f6f67038e99bb8f93267ff07f9a585d8@openmailbox.org \
    --to=ericbavier@openmailbox.org \
    --cc=efraim@flashner.co.il \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).