Definition of a platform (OS) in a schema

It should be something like this:

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

Honestly, I think that my implementation of the circuit cannot even do this anyway, but I am free to implement it. What is the usual schema syntax for platform discovery?

Thank you

+5
source share
2 answers

I can't talk about 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`
+8
source

And guile has a function unamethat returns a description as a vector object of the circuit:

scheme@(guile-user)> (uname)
$2 = #("Linux" "gblaptop" "2.6.39-gentoo-r3" "#4 SMP Fri Oct 21 08:12:17 PDT 2011" "i686")
+1
source

All Articles