[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: string-map arg order
From: |
Dirk Herrmann |
Subject: |
Re: string-map arg order |
Date: |
Thu, 6 Sep 2001 19:14:05 +0200 (MEST) |
On 6 Sep 2001, Alex Shinn wrote:
> Dirk> (define s <some string>)
> Dirk> (define (foo c)
> Dirk> (string-set! s (random-index (length s)) (random-character)))
> Dirk> (string-for-each foo s)
>
> Well, the looping of string-for-each is O(n)... in your example, the
> inside of the loop happens to be an O(n) computation (in a style we
> would have to make clear is inefficient).
No, you have to re-calculate the character position in every iteration
(see my latest mail to Marius, which is more explanative).
Best regards
Dirk Herrmann
- Re: string-map arg order, Dirk Herrmann, 2001/09/03
- Re: string-map arg order, Alex Shinn, 2001/09/03
- Re: string-map arg order, Dirk Herrmann, 2001/09/03
- Re: string-map arg order, Alex Shinn, 2001/09/03
- Re: string-map arg order, Dirk Herrmann, 2001/09/04
- Re: string-map arg order, Alex Shinn, 2001/09/04
- Re: string-map arg order, Dirk Herrmann, 2001/09/05
- Re: string-map arg order, Alex Shinn, 2001/09/05
- Re: string-map arg order, Dirk Herrmann, 2001/09/06
- Re: string-map arg order, Alex Shinn, 2001/09/06
- Re: string-map arg order,
Dirk Herrmann <=
- Re: string-map arg order, Alex Shinn, 2001/09/06
- Re: string-map arg order, Dirk Herrmann, 2001/09/06
- Re: string-map arg order, Alex Shinn, 2001/09/06
- Re: string-map arg order, Dirk Herrmann, 2001/09/06
- Re: string-map arg order, Marius Vollmer, 2001/09/05
- Re: string-map arg order, Dirk Herrmann, 2001/09/06
- Re: string-map arg order, Marius Vollmer, 2001/09/06
- Re: string-map arg order, Neil Jerram, 2001/09/04
Re: string-map arg order, Gary Houston, 2001/09/04