guile-user
[Top][All Lists]
Advanced

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

Re: strange mkstemp! behavior


From: Maarten Grachten
Subject: Re: strange mkstemp! behavior
Date: Mon, 13 Sep 2004 11:21:33 +0200 (CEST)

Thanks RM!

On Mon, 13 Sep 2004 address@hidden wrote:

> On Mon, Sep 13, 2004 at 10:24:27AM +0200, Maarten Grachten wrote:
> > Hi guile people,
> >
> > in 1.6.4, but also in 1.7.1 (didn't try others)  there seems to be
> > something wrong when using mkstemp! several times after another like this:
> >
> > (define (look-at-this x)
> >     (let ((name "/tmp/XXXXXX"))
> >             (write-line name)
> >             (mkstemp! name)))
>
> I'm not a schemer, but doesn't the above code violate the specs?
> '(let ((name "/tmp/XXXXXX"))' binds 'name' to an inmutable string
> (string constants are inmutable).
>
> How about:
>
>  (define (look-at-this x)
>     (let ((name (string-copy "/tmp/XXXXXX")))
>       (write-line name)
>       (mkstemp! name)))
>
> On my system this produces:
>
>  guile> (version )
>  "1.6.4"
>  guile> (map look-at-this '(1 2 3))
>  /tmp/XXXXXX
>  /tmp/XXXXXX
>  /tmp/XXXXXX
>  (#<input-output: /tmp/YoV3f2 3> #<input-output: /tmp/g5Etjk 4> 
> #<input-output: /tmp/uX15kC 5>)
>  guile>
>
>
> HTH Ralf Mattes
>

______________________________________________________________________________

  Maarten Grachten
  Institut d'Investigacio en Intel.ligencia Artificial, IIIA
  Spanish Scientific Research Council, CSIC
  Campus UAB
  08193 Bellaterra, Catalunya, Spain
  Ph.: +34 93 5809570         Fax.: +34 93 5809661
  address@hidden
______________________________________________________________________________

Why limit the freedom of software development? Say `no' to software patents!
http://swpat.ffii.org




reply via email to

[Prev in Thread] Current Thread [Next in Thread]