~peter-pearse/ubuntu/natty/guile-1.8/prop001

« back to all changes in this revision

Viewing changes to lang/elisp/primitives/features.scm

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Schepler
  • Date: 2006-11-09 03:11:16 UTC
  • Revision ID: james.westby@ubuntu.com-20061109031116-hu0q1jxqg12y6yeg
Tags: upstream-1.8.1+1
ImportĀ upstreamĀ versionĀ 1.8.1+1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
(define-module (lang elisp primitives features)
 
2
  #:use-module (lang elisp internals fset)
 
3
  #:use-module (lang elisp internals load)
 
4
  #:use-module (lang elisp internals null)
 
5
  #:use-module (ice-9 optargs))
 
6
 
 
7
(define-public features '())
 
8
 
 
9
(fset 'provide
 
10
      (lambda (feature)
 
11
        (or (memq feature features)
 
12
            (set! features (cons feature features)))))
 
13
 
 
14
(fset 'featurep
 
15
      (lambda (feature)
 
16
        (->nil (memq feature features))))
 
17
 
 
18
(fset 'require
 
19
      (lambda* (feature #:optional file-name noerror)
 
20
        (or (memq feature features)
 
21
            (load (or file-name
 
22
                      (symbol->string feature))
 
23
                  noerror
 
24
                  #f
 
25
                  #f
 
26
                  #t))))