;; -*- scheme -*-x ;; As an example, my personal .snotrc file ;; This file is loaded into the toplevel of the scheme interpreter ;; connected to the snot session and contains symbols exported by ;; snot/snot.ss with appropriate prefixes. ;; This namespace is only used for debugging functions, so basically ;; it's yours to clobber. ;; NOTE: ;; * symbol box commmands are mapped to the corresponding thunk in ;; the toplevel namespace. if you need variables, use ;; parameters. (define-syntax-rule (cmd name . body) (define (name) . body)) ;; * string/path box commands refer to files to be loaded into the ;; toplevel namespace by the function provided in the 'box-load' ;; parameter. here we also look into directories for a .snot file + ;; load relative from box's current dir, not toplevel current dir. (define p expand-user-path) (define (l file) (snot-load/cd (p file))) (box-load l) ;; This is for 'load' and 'require' in the toplevel image. (define (image-top dir) (current-directory (p dir)) (current-load-relative-directory (p dir))) ;; Same for a fresh boxed toplevel. (define (box-top dir) (parameterize ((current-directory (p dir)) (current-load-relative-directory (p dir))) (printf "toplevel ~a\n" (current-directory)) (box-toplevel))) (cmd home (box-top "~")) (cmd tmp (box-top "/tmp")) ;; Shorthands for box commands. (define mb box-mb) (define sec box-sec) ;; quick hack: opening urls in emacs (for 'help') (require net/sendurl) ; (external-browser '("emacsclient -e '(w3m \"" . "\")'")) ; (external-browser '("links2 -g \"" . "\"")) ;; don't need toplevel rep: do everything from within the box repl + ;; unquote commands. (repls '(box box-macro)) ;; Set home directories for image + box. (image-top "~") (home)