Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fmakunbound #443

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 42 additions & 41 deletions doc/jlatex/euslisp.hlp
Original file line number Diff line number Diff line change
Expand Up @@ -184,47 +184,48 @@
"boundp" 2 "jsymbols" 3711 3
"fboundp" 2 "jsymbols" 4054 3
"makunbound" 2 "jsymbols" 4181 3
"get" 2 "jsymbols" 4388 3
"putprop" 2 "jsymbols" 4585 3
"remprop" 2 "jsymbols" 4719 3
"setq" 6 "jsymbols" 4828 3
"set" 2 "jsymbols" 5185 3
"defun" 6 "jsymbols" 5385 3
"defmacro" 6 "jsymbols" 5686 3
"defvar" 3 "jsymbols" 5869 3
"defparameter" 3 "jsymbols" 6133 3
"defconstant" 3 "jsymbols" 6357 3
"keywordp" 2 "jsymbols" 6885 3
"constantp" 2 "jsymbols" 7013 3
"documentation" 2 "jsymbols" 7143 3
"gensym" 2 "jsymbols" 7262 3
"gentemp" 2 "jsymbols" 7829 3
"*lisp-package*" 4 "jsymbols" 11225 2
"*user-package*" 4 "jsymbols" 11278 2
"*unix-package*" 4 "jsymbols" 11339 2
"*system-package*" 4 "jsymbols" 11394 2
"*keyword-package*" 4 "jsymbols" 11458 2
"find-symbol" 2 "jsymbols" 11518 3
"make-symbol" 2 "jsymbols" 11774 3
"intern" 2 "jsymbols" 11891 3
"list-all-packages" 2 "jsymbols" 12245 3
"find-package" 2 "jsymbols" 12347 3
"make-package" 2 "jsymbols" 12462 3
"in-package" 2 "jsymbols" 12735 3
"package-name" 2 "jsymbols" 12874 3
"package-nicknames" 2 "jsymbols" 12975 3
"rename-package" 2 "jsymbols" 13054 3
"package-use-list" 2 "jsymbols" 13331 3
"packagep" 2 "jsymbols" 13423 3
"use-package" 2 "jsymbols" 13510 3
"unuse-package" 2 "jsymbols" 13773 3
"shadow" 2 "jsymbols" 13886 3
"export" 2 "jsymbols" 14030 3
"unexport" 2 "jsymbols" 15257 3
"import" 2 "jsymbols" 15407 3
"do-symbols" 3 "jsymbols" 15819 3
"do-external-symbols" 3 "jsymbols" 16047 3
"do-all-symbols" 3 "jsymbols" 16246 3
"fmakunbound" 2 "jsymbols" 4396 3
"get" 2 "jsymbols" 4625 3
"putprop" 2 "jsymbols" 4822 3
"remprop" 2 "jsymbols" 4956 3
"setq" 6 "jsymbols" 5065 3
"set" 2 "jsymbols" 5422 3
"defun" 6 "jsymbols" 5622 3
"defmacro" 6 "jsymbols" 5923 3
"defvar" 3 "jsymbols" 6106 3
"defparameter" 3 "jsymbols" 6370 3
"defconstant" 3 "jsymbols" 6594 3
"keywordp" 2 "jsymbols" 7122 3
"constantp" 2 "jsymbols" 7250 3
"documentation" 2 "jsymbols" 7380 3
"gensym" 2 "jsymbols" 7499 3
"gentemp" 2 "jsymbols" 8066 3
"*lisp-package*" 4 "jsymbols" 11462 2
"*user-package*" 4 "jsymbols" 11515 2
"*unix-package*" 4 "jsymbols" 11576 2
"*system-package*" 4 "jsymbols" 11631 2
"*keyword-package*" 4 "jsymbols" 11695 2
"find-symbol" 2 "jsymbols" 11755 3
"make-symbol" 2 "jsymbols" 12011 3
"intern" 2 "jsymbols" 12128 3
"list-all-packages" 2 "jsymbols" 12482 3
"find-package" 2 "jsymbols" 12584 3
"make-package" 2 "jsymbols" 12699 3
"in-package" 2 "jsymbols" 12972 3
"package-name" 2 "jsymbols" 13111 3
"package-nicknames" 2 "jsymbols" 13212 3
"rename-package" 2 "jsymbols" 13291 3
"package-use-list" 2 "jsymbols" 13568 3
"packagep" 2 "jsymbols" 13660 3
"use-package" 2 "jsymbols" 13747 3
"unuse-package" 2 "jsymbols" 14010 3
"shadow" 2 "jsymbols" 14123 3
"export" 2 "jsymbols" 14267 3
"unexport" 2 "jsymbols" 15494 3
"import" 2 "jsymbols" 15644 3
"do-symbols" 3 "jsymbols" 16056 3
"do-external-symbols" 3 "jsymbols" 16284 3
"do-all-symbols" 3 "jsymbols" 16483 3
"elt" 2 "jsequences" 584 3
"length" 2 "jsequences" 968 3
"subseq" 2 "jsequences" 1609 3
Expand Down
4 changes: 4 additions & 0 deletions doc/jlatex/jsymbols.tex
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ \subsection{symbol}
{\em symbol}は、(特殊値を持たないように)強制的にunboundされる。
ローカル変数は、いつも値が割り当てられ、{\bf makunbound}できない。}

\funcdesc{fmakunbound}{symbol}{
{\em symbol}に示される関数は、(特殊値を持たないように)強制的にunboundされる。
ローカル関数は、いつも値が割り当てられ、{\bf fmakunbound}できない。}

\funcdesc{get}{sym attribute}{
{\em sym}のplistの中で{\em attribute}に関連する値を取り出す。
{\tt (cdr (assoc {\em attribute} (symbol-plist {\em sym})))}と等価である。}
Expand Down
83 changes: 42 additions & 41 deletions doc/latex/euslisp.hlp
Original file line number Diff line number Diff line change
Expand Up @@ -184,47 +184,48 @@
"boundp" 2 "symbols" 3325 3
"fboundp" 2 "symbols" 3555 3
"makunbound" 2 "symbols" 3653 3
"get" 2 "symbols" 3842 3
"putprop" 2 "symbols" 4016 3
"remprop" 2 "symbols" 4134 3
"setq" 6 "symbols" 4227 3
"set" 2 "symbols" 4544 3
"defun" 6 "symbols" 4690 3
"defmacro" 6 "symbols" 4911 3
"defvar" 3 "symbols" 5058 3
"defparameter" 3 "symbols" 5277 3
"defconstant" 3 "symbols" 5455 3
"keywordp" 2 "symbols" 5869 3
"constantp" 2 "symbols" 5964 3
"documentation" 2 "symbols" 6067 3
"gensym" 2 "symbols" 6154 3
"gentemp" 2 "symbols" 6603 3
"*lisp-package*" 4 "symbols" 9167 2
"*user-package*" 4 "symbols" 9211 2
"*unix-package*" 4 "symbols" 9255 2
"*system-package*" 4 "symbols" 9301 2
"*keyword-package*" 4 "symbols" 9350 2
"find-symbol" 2 "symbols" 9393 3
"make-symbol" 2 "symbols" 9595 3
"intern" 2 "symbols" 9689 3
"list-all-packages" 2 "symbols" 9990 3
"find-package" 2 "symbols" 10063 3
"make-package" 2 "symbols" 10171 3
"in-package" 2 "symbols" 10376 3
"package-name" 2 "symbols" 10512 3
"package-nicknames" 2 "symbols" 10599 3
"rename-package" 2 "symbols" 10675 3
"package-use-list" 2 "symbols" 10909 3
"packagep" 2 "symbols" 10995 3
"use-package" 2 "symbols" 11055 3
"unuse-package" 2 "symbols" 11251 3
"shadow" 2 "symbols" 11355 3
"export" 2 "symbols" 11476 3
"unexport" 2 "symbols" 12371 3
"import" 2 "symbols" 12510 3
"do-symbols" 3 "symbols" 12848 3
"do-external-symbols" 3 "symbols" 13030 3
"do-all-symbols" 3 "symbols" 13191 3
"fmakunbound" 2 "symbols" 3850 3
"get" 2 "symbols" 4049 3
"putprop" 2 "symbols" 4223 3
"remprop" 2 "symbols" 4341 3
"setq" 6 "symbols" 4434 3
"set" 2 "symbols" 4751 3
"defun" 6 "symbols" 4897 3
"defmacro" 6 "symbols" 5118 3
"defvar" 3 "symbols" 5265 3
"defparameter" 3 "symbols" 5484 3
"defconstant" 3 "symbols" 5662 3
"keywordp" 2 "symbols" 6076 3
"constantp" 2 "symbols" 6171 3
"documentation" 2 "symbols" 6274 3
"gensym" 2 "symbols" 6361 3
"gentemp" 2 "symbols" 6810 3
"*lisp-package*" 4 "symbols" 9374 2
"*user-package*" 4 "symbols" 9418 2
"*unix-package*" 4 "symbols" 9462 2
"*system-package*" 4 "symbols" 9508 2
"*keyword-package*" 4 "symbols" 9557 2
"find-symbol" 2 "symbols" 9600 3
"make-symbol" 2 "symbols" 9802 3
"intern" 2 "symbols" 9896 3
"list-all-packages" 2 "symbols" 10197 3
"find-package" 2 "symbols" 10270 3
"make-package" 2 "symbols" 10378 3
"in-package" 2 "symbols" 10583 3
"package-name" 2 "symbols" 10719 3
"package-nicknames" 2 "symbols" 10806 3
"rename-package" 2 "symbols" 10882 3
"package-use-list" 2 "symbols" 11116 3
"packagep" 2 "symbols" 11202 3
"use-package" 2 "symbols" 11262 3
"unuse-package" 2 "symbols" 11458 3
"shadow" 2 "symbols" 11562 3
"export" 2 "symbols" 11683 3
"unexport" 2 "symbols" 12578 3
"import" 2 "symbols" 12717 3
"do-symbols" 3 "symbols" 13055 3
"do-external-symbols" 3 "symbols" 13237 3
"do-all-symbols" 3 "symbols" 13398 3
"elt" 2 "sequences" 521 3
"length" 2 "sequences" 854 3
"subseq" 2 "sequences" 1335 3
Expand Down
5 changes: 5 additions & 0 deletions doc/latex/symbols.tex
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ \subsection{Symbols}
Note that lexical (local) variables always have values assigned and
cannot be {\em makunbound}ed.}

\funcdesc{fmakunbound}{symbol}{
{\em symbol} function is forced to be unbound (to have no special value).
Note that lexical (local) functions always have values assigned and
cannot be {\em fmakunbound}ed.}

\funcdesc{get}{sym attribute}{
retrieves {\em sym}'s value associated with {\em attribute} in its plist.
{\tt = (cdr (assoc {\em attribute} (symbol-plist {\em sym})))}}
Expand Down
1 change: 1 addition & 0 deletions lisp/c/eus_proto.h
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,7 @@ extern pointer SYMBNDVALUE(context */*ctx*/, int /*n*/, pointer /*argv*/*);
extern pointer SETFUNC(context */*ctx*/, int /*n*/, pointer */*argv*/);
extern pointer SYMFUNC(context */*ctx*/, int /*n*/, pointer */*argv*/);
extern pointer MAKUNBOUND(context */*ctx*/, int /*n*/, pointer */*argv*/);
extern pointer FMAKUNBOUND(context */*ctx*/, int /*n*/, pointer */*argv*/);
extern void set_special(context */*ctx*/, pointer /*var*/, pointer /*val*/);
extern pointer SETSPECIAL(context */*ctx*/, int /*n*/, pointer */*argv*/);
extern pointer DEFUN(context */*ctx*/, pointer /*arg*/);
Expand Down
13 changes: 13 additions & 0 deletions lisp/c/specials.c
Original file line number Diff line number Diff line change
Expand Up @@ -1051,6 +1051,18 @@ pointer *argv;
pointer_update(argv[0]->c.sym.speval,UNBOUND);
return(T);}

pointer FMAKUNBOUND(ctx,n,argv)
register context *ctx;
int n;
pointer *argv;
{ ckarg(1);
if (!issymbol(argv[0])) error(E_NOSYMBOL);
#ifdef SPEC_DEBUG
printf( "FMAKEUNBOUND:" ); hoge_print( argv[0] );
#endif
pointer_update(argv[0]->c.sym.spefunc,UNBOUND);
return(T);}

void set_special(ctx, var, val)
context *ctx;
pointer var, val;
Expand Down Expand Up @@ -1330,6 +1342,7 @@ pointer mod;
defun(ctx,"SYMBOL-BOUND-VALUE",mod,SYMBNDVALUE,NULL);
defun(ctx,"SYMBOL-FUNCTION",mod,SYMFUNC,NULL);
defun(ctx,"MAKUNBOUND",mod,MAKUNBOUND,NULL);
defun(ctx,"FMAKUNBOUND",mod,FMAKUNBOUND,NULL);
defun(ctx,"SET",mod,SETSPECIAL,NULL);
defspecial(ctx,"DEFUN",mod,DEFUN);
defspecial(ctx,"DEFMACRO",mod,DEFMACRO);
Expand Down
1 change: 1 addition & 0 deletions lisp/comp/builtins.l
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@
(def-builtin-entry 'LISP::SYMBOL-BOUND-VALUE "SYMBNDVALUE")
(def-builtin-entry 'LISP:SYMBOL-FUNCTION "SYMFUNC")
(def-builtin-entry 'LISP:MAKUNBOUND "MAKUNBOUND")
(def-builtin-entry 'LISP:FMAKUNBOUND "FMAKUNBOUND")
(def-builtin-entry 'LISP:SET "SETSPECIAL")
(def-builtin-entry 'LISP:FIND-SYMBOL "FINDSYMBOL")
(def-builtin-entry 'LISP:INTERN "INTERN")
Expand Down
2 changes: 1 addition & 1 deletion lisp/l/eusstart.l
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
unwind-protect catch throw flet labels block return-from
return reset go tagbody evalhook macroexpand2 eval-when
the and or proclaim declare symbol-value symbol-function
makunbound defun defmacro find-symbol intern gensym
makunbound fmakunbound defun defmacro find-symbol intern gensym
list-all-packages find-package
sxhash get export putprop))
;; makepackage ??
Expand Down
2 changes: 1 addition & 1 deletion lisp/l/exports.l
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
unwind-protect catch throw flet labels block return-from
return reset go tagbody evalhook macroexpand2 eval-when
the and or proclaim declare symbol-value symbol-function
makunbound defun defmacro find-symbol intern gensym
makunbound fmakunbound defun defmacro find-symbol intern gensym
list-all-packages find-package
sxhash get export putprop))
;; makepackage ??
Expand Down