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

Re: [Scheme-reports] Write procedure is not backwards compatible



> You can also do this by manipulating imports.  In the default Chibi
> library (scheme), which is not R7RS-compatible, `write` is the /small-fast
> variety; in the (scheme write) library, it's the /shared variety.

That doesn't seem to cover all use cases that the parameter does.  Suppose a library exports multiple writing procedures that call "write", and a user wants to make one of them use write/shared, but the other use write/safe; or suppose a user wants to use the same procedure in two places in a program, and wants one of the uses to use write/safe and the other to use write/shared.  I guess the user *could* perhaps re-import the library for the sole purpose of getting a version of the exported procedure that uses a different "write"; would that be a serious recommendation (or is that even possible)?

(Also, is it easy for the user to change the structure of imports in a running program, without side-effects other than some function calls being redirected to the new "write"?  I imagine someone using write/small-fast, finding an error, and wanting to switch to write/shared to diagnose the source of the circular input, then fixing the error and wanting to switch back to write/small-fast, without resetting any global state that his library might initialize.  With parameters, this could be trivial.)
--John Boyle
Science is what we understand well enough to explain to a computer. Art is everything else we do. --Knuth



On Fri, Jul 6, 2012 at 3:12 PM, John Cowan <cowan@x> wrote:
Aaron W. Hsu scripsit:

>       write/safe
>       write/shared
>       write/dangerous-stupid-do-not-use-unless-you-think-you-are-neo

Less tendentiously, write/small-fast.

I assume that the first one writes datum labels for cycles but not
for shared structure?  That would seem to violate the whole notion of
read-write equivalence: you write out a value with shared structure as
a datum, but you read it back as a value without shared structure.

> One convenience of the parameter is that you can set it outside of the
> program, rather than having to commit to a specific choice inside.

You can also do this by manipulating imports.  In the default Chibi
library (scheme), which is not R7RS-compatible, `write` is the /small-fast
variety; in the (scheme write) library, it's the /shared variety.

--
You annoy me, Rattray!  You disgust me!         John Cowan
You irritate me unspeakably!  Thank Heaven,     cowan@x
I am a man of equable temper, or I should       http://www.ccil.org/~cowan
scarcely be able to contain myself before
your mocking visage.            --Stalky imitating Macrea

_______________________________________________
Scheme-reports mailing list
Scheme-reports@x
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports

_______________________________________________
Scheme-reports mailing list
Scheme-reports@x
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports