(Linux only)
Want to test a few lines of C ?
Normally you'd have to :
- create
test.c
- write headers
#include <stdfoo.h> #include <stdbar.h>...
- write entry-point
int main (int argc ...) {}
- write your code
- save
- finally run
gcc test.c -Wall -Wbar && ./a.out
Forgot a header ? To link math (-lm
) ?
Bad luck... Now you have to edit test.c
...
No such hassle with lacy :
$ lacy
int i = pow(2,8);
printf ("%d\n", i);
[CTRL+D]
256
lacy can also run files.
$ lacy hello.c
If your code has no main()
, lacy adds classic headers and puts your statements into main()
.
$ lacy hello.c
Hello!
$ lacy hello.c Bob
Hello Bob!
$ cat hello.c | lacy
Hello!
$ lacy
printf ("%s\n", "Hello!");
[CTRL+D]
Hello!
$ lacy 'printf ("%s\n", "Hello!");'
Hello!
$ lacy > new_project.c
(gets you a fresh all-included source)
$ lacy -h
(help)
$ lacy -v
(version)