Hello!
Efraim Flashner skribis:
[...]
>> I prefer the approach Ricardo suggested, I think it’s more concise and
>> clearer:
>>
>> https://lists.gnu.org/archive/html/guix-devel/2016-06/msg00525.html
>>
>> Also, note that @@ would not be needed here; @@ serves to access private
>> bindings w
On Wed, Jun 15, 2016 at 03:56:43PM +0200, Ludovic Courtès wrote:
> Efraim Flashner skribis:
>
> > From 09eef9cd841a7d212e024be0609168611923696b Mon Sep 17 00:00:00 2001
> > From: Efraim Flashner
> > Date: Sun, 22 May 2016 14:56:06 +0300
> > Subject: [PATCH] bournish: Add `wc' command.
> >
> > *
Efraim Flashner skribis:
> From 09eef9cd841a7d212e024be0609168611923696b Mon Sep 17 00:00:00 2001
> From: Efraim Flashner
> Date: Sun, 22 May 2016 14:56:06 +0300
> Subject: [PATCH] bournish: Add `wc' command.
>
> * guix/build/bournish.scm (lines+chars, only-files, wc-commands,
> wc-command-imple
Efraim Flashner writes:
>> It's already calling `((@@ (guix build bournish)
>> wc-l-command-implementation) ,@(delete "-l" args)), I could try changing
>> the ,@(delete part to ,@((@@ (guix build bournish) only-files) ,@(delete
>> "-l" args)) and then the various implementation functions will be
On Tue, Jun 14, 2016 at 01:20:29PM +0300, Efraim Flashner wrote:
> On Tue, Jun 14, 2016 at 11:57:26AM +0200, Ricardo Wurmus wrote:
> >
> > Efraim Flashner writes:
> >
> > > +(define wc-command-implementation
> > > + (lambda files
> > > +(let ((files (filter (lambda (file)
> > > +
On Tue, Jun 14, 2016 at 11:57:26AM +0200, Ricardo Wurmus wrote:
>
> Efraim Flashner writes:
>
> > +(define wc-command-implementation
> > + (lambda files
> > +(let ((files (filter (lambda (file)
> > + (catch 'system-error
> > + (lambda ()
Efraim Flashner writes:
> +(define wc-command-implementation
> + (lambda files
> +(let ((files (filter (lambda (file)
> + (catch 'system-error
> + (lambda ()
> + (stat file))
> +
On Wed, Jun 08, 2016 at 05:43:09PM +0200, Ludovic Courtès wrote:
> Efraim Flashner skribis:
>
> > On Sun, Jun 05, 2016 at 10:37:12PM +0200, Ludovic Courtès wrote:
>
> [...]
>
> >> I’ll commit a couple of fixes for bugs I just found and that prevent us
> >> from doing:
> >>
> >> (compile "ls"
Efraim Flashner skribis:
> On Sun, Jun 05, 2016 at 10:37:12PM +0200, Ludovic Courtès wrote:
[...]
>> I’ll commit a couple of fixes for bugs I just found and that prevent us
>> from doing:
>>
>> (compile "ls" #:from %bournish-language #:to 'scheme).
(This should be be ‘read-and-compile’, not
On Sun, Jun 05, 2016 at 10:37:12PM +0200, Ludovic Courtès wrote:
> Efraim Flashner skribis:
> > +
> > +(define* (wc-command-implementation file #:optional args)
> > + (let-values (((lines chars)
> > +(call-with-input-file file lines+chars)))
> > +(match args
> > + (#\l
>
Efraim Flashner skribis:
> I've been working more on this and I think it's much better now.
> Currently it checks for `-l' or `-c' flags in the first position and
> with some borrowing of code from the ls-command I've worked out
> returning an error (out of order) when a file doesn't exist. And i
I've been working more on this and I think it's much better now.
Currently it checks for `-l' or `-c' flags in the first position and
with some borrowing of code from the ls-command I've worked out
returning an error (out of order) when a file doesn't exist. And if
there's no flag then it attempts
On Fri, May 27, 2016 at 11:28 AM, Taylan Ulrich Bayırlı/Kammer
wrote:
> By the way, I prefer SRFI-11 let-values (standardized in R7RS):
>
> (define (wc-command file)
> (let-values (((lines words chars)
> (call-with-input-file file lines+chars)))
> ...))
>
> T
Eric Bavier writes:
> 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'
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 #
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)
;;; /home/efraim/workspace/guix/guix/build/bournish.scm:143:2: warning:
wrong number of arguments to `#'
It's not ready as-is, but I wanted to show what I had s
On Thu, May 26, 2016 at 10:46:21AM +0200, Ludovic Courtès wrote:
>
> As Ricardo suggests, you could use ‘port->stream’ and ‘stream-fold’ to
> iterate over the characters read from the port. I suspect that’d be
> rather slow though, at least on 2.0, so another option is something
> like:
>
> (d
Hello!
Efraim Flashner skribis:
> GSoC just started and so far I have 13 tabs from the guile manual open
> on my computer. I almost implemented `du' at the same time as `wc' but
> at the time I was getting tripped up with functions returning functions
> or returning values.
Nice!
Some comments
On Wed, May 25, 2016 at 11:26:11AM +0200, Ricardo Wurmus wrote:
>
> Efraim Flashner writes:
>
> > +(define (wc-l-command file)
> > + (let* ((input-file (open-file file "r"))
> > + (line (read-line input-file))
> > + (line-count 0))
> > +(while (not (eof-object? line))
On Wed, May 25, 2016 at 11:03:34AM +0200, Ricardo Wurmus wrote:
>
> Efraim Flashner writes:
>
> > +(define (wc-command file)
> > + (if (and (file-exists? file) (access? file 4))
> > + (let* ((wc-l ((@@ (guix build bournish) wc-l-command) file))
> > +(wc-w ((@@ (guix build bourni
Efraim Flashner writes:
> +(define (wc-l-command file)
> + (let* ((input-file (open-file file "r"))
> + (line (read-line input-file))
> + (line-count 0))
> +(while (not (eof-object? line))
> + (set! line-count (1+ line-count))
> + (set! line (read-l
Efraim Flashner writes:
> +(define (wc-command file)
> + (if (and (file-exists? file) (access? file 4))
> + (let* ((wc-l ((@@ (guix build bournish) wc-l-command) file))
> +(wc-w ((@@ (guix build bournish) wc-w-command) file))
> +(wc-c ((@@ (guix build bournish) wc-c-
GSoC just started and so far I have 13 tabs from the guile manual open
on my computer. I almost implemented `du' at the same time as `wc' but
at the time I was getting tripped up with functions returning functions
or returning values.
`wc-l' and `wc-w' are two separate functions ATM. It should be
23 matches
Mail list logo