loading...

re: Rust working with paths VIEW POST

FULL DISCUSSION
 

Nim lang one-liner Std Lib:

import os
echo getCurrentDir() / paramStr(1)

Use:

nim c -r file.nim param
/home/juan/param

(Its 2 Lines, but import can be passed on command with --import:os, so is 1)

 

Passing command line imports that's cheeting, still two lines just injected haha. I got the rust thing working thanks to Ben.

 

But you dont have to pass command line imports, you can use a file.nim.cfg:

--import:os

But it was not about Code Golf anyways.
👑

Well played 😁

Code of Conduct Report abuse