mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-07-07 10:00:23 +02:00
scm_i_program_properties is internal; just use procedure-properties
* libguile/programs.h: * libguile/programs.c (scm_i_program_properties): Make internal. (scm_program_name): Use scm_i_program_properties. * libguile/procprop.c (scm_procedure_properties): Use scm_i_program_properties, for programs. * libguile/procs.c (scm_procedure_documentation): Use procedure-property to get to 'documentation, not program-property. * module/system/vm/program.scm (program-properties, program-property): Remove from the exports list. (program-documentation): Use procedure-property. * module/texinfo/reflection.scm (macro-arguments) (macro-additional-stexi) (object-stexi-documentation): Use procedure-property, not program-property.
This commit is contained in:
parent
90fa152c1d
commit
07e424b753
6 changed files with 14 additions and 23 deletions
|
@ -88,7 +88,7 @@ SCM_DEFINE (scm_procedure_properties, "procedure-properties", 1, 0, 0,
|
|||
if (scm_is_false (ret))
|
||||
{
|
||||
if (SCM_PROGRAM_P (proc))
|
||||
ret = scm_program_properties (proc);
|
||||
ret = scm_i_program_properties (proc);
|
||||
else
|
||||
ret = SCM_EOL;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 1995,1996,1997,1999,2000,2001, 2006, 2008, 2009 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1995,1996,1997,1999,2000,2001, 2006, 2008, 2009, 2010 Free Software Foundation, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public License
|
||||
|
@ -86,10 +86,7 @@ SCM_DEFINE (scm_procedure_documentation, "procedure-documentation", 1, 0, 0,
|
|||
#define FUNC_NAME s_scm_procedure_documentation
|
||||
{
|
||||
SCM_VALIDATE_PROC (SCM_ARG1, proc);
|
||||
if (SCM_PROGRAM_P (proc))
|
||||
return scm_assq_ref (scm_program_properties (proc), sym_documentation);
|
||||
else
|
||||
return SCM_BOOL_F;
|
||||
return scm_procedure_property (proc, sym_documentation);
|
||||
}
|
||||
#undef FUNC_NAME
|
||||
|
||||
|
|
|
@ -244,10 +244,9 @@ SCM_DEFINE (scm_program_arities, "program-arities", 1, 0, 0,
|
|||
}
|
||||
#undef FUNC_NAME
|
||||
|
||||
SCM_DEFINE (scm_program_properties, "program-properties", 1, 0, 0,
|
||||
(SCM program),
|
||||
"")
|
||||
#define FUNC_NAME s_scm_program_properties
|
||||
SCM
|
||||
scm_i_program_properties (SCM program)
|
||||
#define FUNC_NAME "%program-properties"
|
||||
{
|
||||
SCM meta;
|
||||
|
||||
|
@ -267,7 +266,7 @@ SCM_DEFINE (scm_program_name, "program-name", 1, 0, 0,
|
|||
#define FUNC_NAME s_scm_program_name
|
||||
{
|
||||
SCM_VALIDATE_PROGRAM (1, program);
|
||||
return scm_assq_ref (scm_program_properties (program), scm_sym_name);
|
||||
return scm_assq_ref (scm_i_program_properties (program), scm_sym_name);
|
||||
}
|
||||
#undef FUNC_NAME
|
||||
|
||||
|
|
|
@ -56,7 +56,6 @@ SCM_API SCM scm_program_bindings (SCM program);
|
|||
SCM_API SCM scm_program_sources (SCM program);
|
||||
SCM_API SCM scm_program_source (SCM program, SCM ip);
|
||||
SCM_API SCM scm_program_arities (SCM program);
|
||||
SCM_API SCM scm_program_properties (SCM program);
|
||||
SCM_API SCM scm_program_name (SCM program);
|
||||
SCM_API SCM scm_program_objects (SCM program);
|
||||
SCM_API SCM scm_program_module (SCM program);
|
||||
|
@ -67,6 +66,7 @@ SCM_API SCM scm_program_objcode (SCM program);
|
|||
|
||||
SCM_API SCM scm_c_program_source (SCM program, size_t ip);
|
||||
|
||||
SCM_INTERNAL SCM scm_i_program_properties (SCM program);
|
||||
SCM_INTERNAL int scm_i_program_arity (SCM program, int *req, int *opt, int *rest);
|
||||
SCM_INTERNAL void scm_i_program_print (SCM program, SCM port,
|
||||
scm_print_state *pstate);
|
||||
|
|
|
@ -28,8 +28,7 @@
|
|||
|
||||
source:addr source:line source:column source:file
|
||||
program-sources program-source
|
||||
program-properties program-property program-documentation
|
||||
program-name
|
||||
program-documentation program-name
|
||||
|
||||
program-bindings program-bindings-by-index program-bindings-for-ip
|
||||
program-arities program-arity arity:start arity:end
|
||||
|
@ -64,11 +63,8 @@
|
|||
(define (source:column source)
|
||||
(cdddr source))
|
||||
|
||||
(define (program-property prog prop)
|
||||
(assq-ref (program-properties prog) prop))
|
||||
|
||||
(define (program-documentation prog)
|
||||
(assq-ref (program-properties prog) 'documentation))
|
||||
(procedure-property prog 'documentation))
|
||||
|
||||
(define (collapse-locals locs)
|
||||
(let lp ((ret '()) (locs locs))
|
||||
|
|
|
@ -37,7 +37,6 @@
|
|||
#:use-module (ice-9 session)
|
||||
#:use-module (ice-9 documentation)
|
||||
#:use-module (ice-9 optargs)
|
||||
#:use-module (system vm program)
|
||||
#:use-module ((sxml transform) #:select (pre-post-order))
|
||||
#:export (module-stexi-documentation
|
||||
script-stexi-documentation
|
||||
|
@ -127,14 +126,14 @@
|
|||
(process-args
|
||||
(case type
|
||||
((syntax-rules)
|
||||
(let ((patterns (program-property transformer 'patterns)))
|
||||
(let ((patterns (procedure-property transformer 'patterns)))
|
||||
(if (pair? patterns)
|
||||
(car patterns)
|
||||
'())))
|
||||
((identifier-syntax)
|
||||
'())
|
||||
((defmacro)
|
||||
(or (program-property transformer 'defmacro-args)
|
||||
(or (procedure-property transformer 'defmacro-args)
|
||||
'()))
|
||||
(else
|
||||
;; a procedural (syntax-case) macro. how to document these?
|
||||
|
@ -143,7 +142,7 @@
|
|||
(define (macro-additional-stexi name type transformer)
|
||||
(case type
|
||||
((syntax-rules)
|
||||
(let ((patterns (program-property transformer 'patterns)))
|
||||
(let ((patterns (procedure-property transformer 'patterns)))
|
||||
(if (pair? patterns)
|
||||
(map (lambda (x)
|
||||
`(defspecx (% (name ,name)
|
||||
|
@ -228,7 +227,7 @@
|
|||
(category "Class"))))
|
||||
((is-a? object <macro>)
|
||||
(let* ((proc (macro-transformer object))
|
||||
(type (and proc (program-property proc 'macro-type))))
|
||||
(type (and proc (procedure-property proc 'macro-type))))
|
||||
`(defspec (% (name ,name)
|
||||
(arguments ,@(macro-arguments name type proc)))
|
||||
,@(macro-additional-stexi name type proc)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue