[plt-scheme] Problems reading contracts

From: Robby Findler (robby at cs.uchicago.edu)
Date: Sat Aug 23 14:24:16 EDT 2008

The with-output-to-file function in the scheme language is different
than the one in the mzscheme language. In the scheme language, you
need a keyword

  #:exists 'truncate

and in the mzscheme language, you just need the symbol.

hth,
Robby

On Sat, Aug 23, 2008 at 1:14 PM, geb a <geb_a at yahoo.com> wrote:
> I am having trouble understanding the new documentation using contracts.  I would like to overwrite a file that exists but I'm doing something improperly.
>
> my code:
> (with-output-to-file "foo.txt" (lambda() (write x)) 'truncate)
>
> The documentation says that
> mode-flag : (one-of/c 'binary 'text) = 'binary
>                (one-of/c 'error 'append 'update 'replace 'truncate 'truncate/replace)
>
> I've tried many different combinations of flags but have not been able to land on the right one.  Would someone explain the above notation to me so that I will be able to read the documenation a bit better?
>
> Thanks so much for your time.
>
> Sincerely,
>
> Dan
>
>
>
> _________________________________________________
>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>
>


Posted on the users mailing list.