(use-modules (srfi srfi-1)
(srfi srfi-13))
-(define-public %bot:loadpath (list
- (string-append (getenv "HOME")
- "/.bobotpp/scripts/")
- bot:sys-scripts-dir))
-
-(define-public %bot:load-extensions %load-extensions)
+(set! %load-path (cons* (string-append (getenv "HOME") "/.bobotpp/scripts/")
+ bot:sys-scripts-dir
+ %load-path))
;;; bot:log: Write as many messages as you want to the log. If the
;;; arg is a thunk it will be executed and it's output will be
messages)
(bot:flushport))
-(define-public (bot:load file)
- (let path-loop ((load-path %bot:loadpath))
- (cond ((not (null? load-path))
- (if (not
- (let ext-loop ((extensions %bot:load-extensions))
- (cond ((not (null? extensions))
- (if (catch 'system-error
- (lambda ()
- (load
- (string-append (car load-path)
- file
- (car extensions)))
- #t)
- (lambda args
- #f ))
- #t
- (ext-loop (cdr extensions))))
- (else #f))))
- (path-loop (cdr load-path))))
- (else
- (begin (bot:log "ERROR: File " file " Not Found!\n") #f)))))
+(define-public bot:load load-from-path)
(define-public (bot:load-module module-spec)
(let ((module->string