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

Re: predicate->char-set considered harmful

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

   I'm trying to think of a way to embed an escape procedure into
   predicate->char-set[!].  Is the following legal?  Does it solve
   the "I only want to examine ASCII characters to build this set"

   (define cs
     (let ((result (char-set)))
	(lambda (exit)
	  (predicate->char-set! (lambda (ch) (or (char=? ch #\newline)
						 (and (> (char->integer ch) 127)

   I suppose one would need a guarantee that characters are examined in
   (char->integer ch) order, and it would have to add the character to
   result immediately when the predicate returned true, and it isn't
   linear update, and ...

Yep, the spec doesn't give you any of these guarantees.

Don't fight the system. Be one with the system.