Lazy (take-while)

11 views
Skip to first unread message

Scott Heidbrink

unread,
Dec 4, 2013, 4:31:17 PM12/4/13
to byu-cs-330...@googlegroups.com
You say this is NOT filter. How is it different than filter? or was that to say we can't use the (filter) function in our implementation?

Jay McCarthy

unread,
Dec 4, 2013, 4:32:27 PM12/4/13
to Scott Heidbrink, BYU CS 330 Fall 2013
(filter even? (list 1 2 3 4 5 6)) = (list 2 4 6)
(take-while even? (list 1 2 3 4 5 6)) = empty
(filter odd? (list 1 2 3 4 5 6)) = (list 1 3 5)
(take-while odd? (list 1 2 3 4 5 6)) = (list 1)
> --
> You received this message because you are subscribed to the Google Groups
> "byu-cs-330-fall-2013" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to byu-cs-330-fall-...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.



--
Jay McCarthy <j...@cs.byu.edu>
Assistant Professor / Brigham Young University
http://faculty.cs.byu.edu/~jay

"The glory of God is Intelligence" - D&C 93

Scott Heidbrink

unread,
Dec 4, 2013, 4:33:47 PM12/4/13
to byu-cs-330...@googlegroups.com, Scott Heidbrink
o ok that makes sense then.


On Wednesday, December 4, 2013 2:32:27 PM UTC-7, Jay McCarthy wrote:
(filter even? (list 1 2 3 4 5 6)) = (list 2 4 6)
(take-while even? (list 1 2 3 4 5 6)) = empty
(filter odd? (list 1 2 3 4 5 6)) = (list 1 3 5)
(take-while odd? (list 1 2 3 4 5 6)) = (list 1)

On Wed, Dec 4, 2013 at 2:31 PM, Scott Heidbrink
<scott.h...@gmail.com> wrote:
> You say this is NOT filter. How is it different than filter? or was that to
> say we can't use the (filter) function in our implementation?
>
> --
> You received this message because you are subscribed to the Google Groups
> "byu-cs-330-fall-2013" group.
> To unsubscribe from this group and stop receiving emails from it, send an
Reply all
Reply to author
Forward
0 new messages