fns.scm 904 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. (define-module (lang elisp primitives fns)
  2. #:use-module (lang elisp internals set)
  3. #:use-module (lang elisp internals fset)
  4. #:use-module (lang elisp internals null))
  5. (fset 'fset fset)
  6. (fset 'defalias fset)
  7. (fset 'apply elisp-apply)
  8. (fset 'funcall
  9. (lambda (function . args)
  10. (elisp-apply function args)))
  11. (fset 'interactive-p
  12. (lambda ()
  13. %nil))
  14. (fset 'commandp
  15. (lambda (sym)
  16. (if (interactive-specification (fref sym)) #t %nil)))
  17. (fset 'fboundp
  18. (lambda (sym)
  19. (->nil (variable? (symbol-fref sym)))))
  20. (fset 'symbol-function fref/error-if-void)
  21. (fset 'macroexpand macroexpand)
  22. (fset 'subrp
  23. (lambda (obj)
  24. (->nil (not (not-subr? obj)))))
  25. (fset 'byte-code-function-p
  26. (lambda (object)
  27. %nil))
  28. (fset 'run-hooks
  29. (lambda hooks
  30. (for-each (lambda (hooksym)
  31. (for-each (lambda (fn)
  32. (elisp-apply fn '()))
  33. (value hooksym #f)))
  34. hooks)))