[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

This page is part of the web mail archives of SRFI 121 from before July 7th, 2015. The new archives for SRFI 121 contain all messages, not just those from before July 7th, 2015.

*To*: "Kevin Wortman" <kwortman@xxxxxxxxx>*Subject*: Re: SRFI 121: Generators*From*: cowan@xxxxxxxx*Date*: Tue, 24 Feb 2015 09:50:58 -0500*Cc*: cowan@xxxxxxxx, srfi-121@xxxxxxxxxxxxxxxxx*Delivered-to*: srfi-121@xxxxxxxxxxxxxxxxx*Importance*: Normal*In-reply-to*: <CAD2CXeuEN7h_QVMDig8BXJQo+=vpi3TkN2sxEJuw1GTcTqVCYQ@mail.gmail.com>*References*: <y9lr3u6q90q.fsf@deinprogramm.de> <y9ltwyyrexj.fsf@deinprogramm.de> <20150206234521.GE7000@mercury.ccil.org> <54D62E4D.2060300@bothner.com> <20150208003104.GF14765@mercury.ccil.org> <54D82299.5090709@bothner.com> <CAD2CXet=JNn5KRR-nMoGen0TiYdCXkT7xaO2WVFxGrOsQvtmWA@mail.gmail.com> <b28d281fb7ddc2cd26306f8bccb4a846.squirrel@www.ccil.org> <CAD2CXeuEN7h_QVMDig8BXJQo+=vpi3TkN2sxEJuw1GTcTqVCYQ@mail.gmail.com>*User-agent*: SquirrelMail/1.4.21

Kevin Wortman scripsit: > OK, so this should be explicitly defined somewhere right? A programmer > needs to know what data types they may safely assume will work. I imagine > that for the purposes of this SRFI, "collection" may be any of list, > vector, bytevector, string, or generator. No, it can be anything with a for-each function with the right signature. A positive integer is a collection, given this function: (define (integer-for-each proc n) (let loop ((n n)) (unless (= n 0) (proc (remainder n 10)) (loop (quotient n 10))))) I'm not sure how best to explain this. Suggestions, anyone? > Well if a sequence has duplicates then it isn't really a mathematical set, > and the conventional definition of set union, etc. does not work. It's > then > unclear whether these are actually multiset operations, where duplicates > should be retained in the output; or whether they are set operations, and > duplicates should be filtered out of input before performing the > conventional set operations. You're right, it is unclear. Given the existence of a generator operation for deleting neighbor duplicates, we might as well assume that there are none. > A less important consideration is that handling duplicates takes some > effort, so these procedures can be faster if they are free to assume that > inputs have no duplicates. Good point. I'll revise accordingly. -- John Cowan http://www.ccil.org/~cowan cowan@xxxxxxxx A mosquito cried out in his pain, "A chemist has poisoned my brain!" The cause of his sorrow / Was para-dichloro- Diphenyltrichloroethane. (aka DDT)

**Follow-Ups**:**Re: SRFI 121: Generators***From:*Kevin Wortman

**References**:**Re: SRFI 121: Generators***From:*Arthur A. Gleckler

**Re: SRFI 121: Generators***From:*John Cowan

**Re: SRFI 121: Generators***From:*Per Bothner

**Re: SRFI 121: Generators***From:*John Cowan

**Re: SRFI 121: Generators***From:*Per Bothner

**Re: SRFI 121: Generators***From:*Kevin Wortman

**Re: SRFI 121: Generators***From:*cowan

**Re: SRFI 121: Generators***From:*Kevin Wortman

- Prev by Date:
**Re: SRFI 121: Generators** - Next by Date:
**Re: SRFI 121: Generators** - Previous by thread:
**Re: SRFI 121: Generators** - Next by thread:
**Re: SRFI 121: Generators** - Index(es):