Pergunta

That must be something like that :

(if (= system-type 'gnu/linux)
    (system "make"))

To be honest I think my scheme implementation even can't do it in anyways but I'm free to add realization for it. What is usual scheme syntax for Platform detection?

thank you

Foi útil?

Solução

I can't speak for any other Schemes, but Racket has a procedure called system-type:

> (system-type)
'unix
> (system-type 'machine)
"Linux ... x86_64 GNU/Linux"  ;; ellipses mine, output is same as `uname -a`

Outras dicas

And guile has a uname function, which returns a description as a scheme vector object:

scheme@(guile-user)> (uname)
$2 = #("Linux" "gblaptop" "2.6.39-gentoo-r3" "#4 SMP Fri Oct 21 08:12:17 PDT 2011" "i686")
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top