Changeset 13680 in project


Ignore:
Timestamp:
03/11/09 03:29:50 (11 years ago)
Author:
Kon Lovett
Message:

Save

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/4/apropos/trunk/apropos.scm

    r13679 r13680  
    141141    (values (make-apropos-regexp patt) env macenv) ) )
    142142
    143 (define (*apropos-list loc regexp  env macenv)
     143(define (*apropos-list loc regexp env macenv)
    144144  (append
    145145   (search-environment env regexp global-bound?)
    146146   (if macenv (search-macro-environment macenv regexp) '())) )
     147
     148(define (*environment-apropos-list loc regexp env)
     149  (cond ((##sys#environment? env)           (search-environment env regexp global-bound?))
     150        ((##sys#syntactic-environment? env) (search-macro-environment env regexp))
     151        (else
     152         (%error-invalid-environment 'environment-apropos-list env) ) ) )
    147153
    148154;; Display
     
    176182;;; API
    177183
     184;; Original
     185
    178186(define (apropos patt . rest)
    179187  (let-values (((regexp env macenv) (parse-arguments args)))
     
    192200     (*apropos-list 'apropos regexp env macenv)) ) )
    193201
     202;; Crispy
     203
     204(define (environment-apropos loc regexp env)
     205  (let-values (((regexp env macenv) (parse-arguments args)))
     206    (let* ((syms (*environment-apropos-list loc regexp env))
     207           (maxsymlen (largest-symbol-string-length syms)))
     208      (for-each (cut display-symbol-information <> env macenv maxsymlen) syms) ) ) )
     209
    194210(define (environment-apropos-list loc regexp env)
    195211  (let-values (((regexp env macenv) (parse-arguments args)))
    196     (%check-search-pattern 'environment-apropos-list patt)
    197     (cond ((##sys#environment? env)           (search-environment env regexp global-bound?))
    198           ((##sys#syntactic-environment? env) (search-macro-environment env regexp))
    199           (else
    200            (%error-invalid-environment 'environment-apropos-list env) ) ) ) )
     212    (*environment-apropos-list loc regexp env) ) )
    201213
    202214(define (environment-apropos-information-list loc regexp env)
    203215  (let-values (((regexp env macenv) (parse-arguments args)))
    204     (%check-search-pattern 'environment-apropos-list patt)
    205216    (map
    206217     (lambda (sym) (list sym (apropos-information sym)))
    207      (cond ((##sys#environment? env)           (search-environment env regexp global-bound?))
    208            ((##sys#syntactic-environment? env) (search-macro-environment env regexp))
    209            (else
    210             (%error-invalid-environment 'environment-apropos-list env)))) ) )
     218     (*environment-apropos-list loc regexp env)) ) )
    211219
    212220) ;module apropos
Note: See TracChangeset for help on using the changeset viewer.