[Fluxus] path&string

Kassen signal.automatique at gmail.com
Thu Jan 13 18:42:06 PST 2011


Dear list,

Gabor asked me to report on stuff I found odd, so;

I just wrote this;

(define (pick1 in)
    (list-ref in (random (length in))))

(define zep-skins
    (let ((dir "fluxus/twintowers/zeppelins/"))
        (map
            (lambda (x)
                (load-texture (string-append dir (path->string x))))
            (directory-list dir))))

This is used to set a different texture for a Zeppelin model each time, and
pre-load all. I like it; it's compact and expressive... but I don't like the
conversion up&down between "path" and "string". Previously (before I had a
need to load whole directories at once) I was unaware of "path" being a
type.

IMHO something is going wrong here (quite possibly me); I'm getting a "path"
that's just a file name (and not a actual path) and "(load-texture t)" which
expects a actual path takes a string. This might be a Racket issue, it could
be Fluxus one or it could be me trying something new, but something tells me
this could be both more compact and more logical.

Yours,
Kas.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pawfal.org/pipermail/fluxus-pawfal.org/attachments/20110114/293949a1/attachment-0002.htm>


More information about the Fluxus mailing list