[plt-scheme] Where to find out that library objects like "chmod" are available in the underlying implementation?

From: Eli Barzilay (eli at barzilay.org)
Date: Tue Oct 7 02:43:04 EDT 2008

[Adding a little on top of what Noel said]

On Oct  3, Ernie Smith wrote:
> Many reasonable inferences can be made, but one would find comfort
> in finding an assertion like the above somewhere in the
> documentation with or without caveats.  The kind of comfort that
> permits you to make the bold assumption that this may continue in
> later versions.  Otherwise the amount of maintenance and
> installation baggage that goes with a simple script goes up
> dramatically as well as the risks.

Relying on something like the standard C library being included is
pretty much guaranteed.  Dumping it is as practical as it is to
reimplement mzscheme on top of a different VM.


> (define chmod (get-ffi-obj "chmod" #f (_fun _path _int -> _void)))

But for things that you suspect are more Linux/Mac/Windows specific,
you can of course just name the dynamic library directly.  In the
`chmod' case, you'll probably need different code anyway on Windows.

Buut don't forget that there is another use for #f as the library --
it's the way to use internal MzScheme functionality (stuff that is
described in the inside mzscheme manual) from inside Scheme.

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!


Posted on the users mailing list.