[prev in list] [next in list] [prev in thread] [next in thread]
List: racket-users
Subject: [racket] sequence-filter of in-port
From: rcleis () me ! com (Richard Cleis)
Date: 2012-07-22 18:54:30
Message-ID: 1B22A9D4-43C1-4CF6-BCE3-F81B87DB879B () me ! com
[Download RAW message or body]
I just downloaded 5.2.1. It works, too. I am slow to upgrade because I don't fix what \
ain't broke. That was broke, so I fixed it by upgrading. Now I have a better \
understanding of how sequences work, too.
rac
On Jul 22, 2012, at 10:57 AM, Adolfo P?rez ?lvarez wrote:
> Hi Richard,
>
> What version of Racket are you using? I've tested your code with
> 5.3.0.16 and it worked as expected, returning '() in both cases.
>
> 2012/7/22 Richard Cleis <rcleis at me.com>:
> > I was attempting to use sequence-filter and in-port to filter large files into \
> > small lists, but the following error occurs on the occasion that everything is \
> > filtered:
> > apply: expects type <proper list> as 2nd argument, given: #f; other arguments \
> > were: #<procedure:might-filter-all>
> > ;; equivalent arbitrary examples (I think)
> >
> > (define (might-filter-all x) (= x 99)) ; both cases below return '(3), if 99 is \
> > changed to 3
> > (sequence->list (sequence-filter might-filter-all (in-range 3 4))) \
> > ; returns '() (sequence->list (sequence-filter might-filter-all (in-port read \
> > (open-input-string "3")))) ; an error
> > I could not find in-port in sequence.rkt, so I did not read it.
> >
> > Should the in-port sequence be different?
> >
> > rac
> >
> > ____________________
> > Racket Users list:
> > http://lists.racket-lang.org/users
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic