Advertisement
Guest User

Untitled

a guest
Dec 7th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. Hi margaritamike,
  2.  
  3. With the help you provided, we have done most of the work needed to add SBCL to Kattis. However, I have a question for you since I am not a LISP guy.
  4.  
  5. If someone wants to submit a program over multiple files, what is the "best" way to include one file in the other?
  6.  
  7.  
  8. I managed to make a two-file submission work in the following manner:
  9.  
  10. file "hello.lisp" has the following contents:
  11. (defconstant HELLO "Hello World!")
  12.  
  13. file "main.lisp" has the following contents:
  14. (load (merge-pathnames "hello" *load-truename*))
  15. (format t "~a~%" HELLO)
  16.  
  17. These files are compiled (to hello.fasl and main.fasl) and all four (source and compiled) files reside in /src/.
  18.  
  19. We then run the program by doing "/usr/sbin/sbcl --noinform --non-interactive --load /src/main"
  20.  
  21. It would be nice to have that "load" command be just '(load "hello")'. The reason I have added the "merge-pathnames" is to say "look for the file in the same directory as this file". But I use this load because when we invoke sbcl, our working directory is not /src, and it cannot find "hello" with the "simple" load.
  22.  
  23. Is the solution I came up with reasonable? Or is there a simpler one that I'm missing?
  24.  
  25. Best,
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement