sample.trp 642 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #! /usr/bin/tripl
  2. < "libc-2.33.so" @ shared;
  3. # now we're testing the c-style declares
  4. int main(int argc, const char **argv);
  5. extern int fputs(char *, int);
  6. # and tripl-style
  7. < add(a, b) @ fn;
  8. $ a;
  9. $ b;
  10. $ c;
  11. -10 -> a;
  12. a = b = 1000;
  13. a = ` "/usr/bin/bash" {
  14. echo "greeting from bash :-)"
  15. exit 100
  16. };
  17. c = ` "./tripl" {
  18. $ a = 0;
  19. a = ` "/usr/bin/bash" {
  20. echo -n "this is a bash and it is running in a tripl-interpreter which"
  21. echo "are running in a tripl-interpreter"
  22. exit 10
  23. };
  24. ! @ var;
  25. };
  26. # @ var means, only view value of var, but not functions and libraries.
  27. ! @ var;
  28. b = a = $ 1 + 1 * 100 / 12;
  29. !;