Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Platform (OS) detection in scheme

Tags:

scheme

r6rs

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

like image 422
cnd Avatar asked Feb 22 '23 18:02

cnd


1 Answers

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`
like image 124
Ryan Culpepper Avatar answered Feb 27 '23 09:02

Ryan Culpepper