Lisp HUG Maillist Archive

Functions named by keywords

Hey!

Is there any technical limitation for why LispWorks does not allow for
defining/calling functions named by keywords?

For instance, (defun :foo () 42) and then calling (:foo) seems to work
as with any other symbols in all other implementations I have tested.

BR
Michał "phoe" Herda




_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html

Re: Functions named by keywords

I discovered similar abilities last week for FLET and LABELS. I hadn’t tried doing a direct DEFUN with a keyword name. But the spec just calls for a symbol, and a keyword is certainly a symbol. In my case there were advantages to allowing keywords to name LABELS functions in DLAMBDA-style (a-la Doug Comer). It enables one sub-function calling another directly using its key.

- DM

> On Oct 24, 2020, at 5:29 AM, Michał phoe Herda <phoe@disroot.org> wrote:
> 
> Hey!
> 
> Is there any technical limitation for why LispWorks does not allow for
> defining/calling functions named by keywords?
> 
> For instance, (defun :foo () 42) and then calling (:foo) seems to work
> as with any other symbols in all other implementations I have tested.
> 
> BR
> Michał "phoe" Herda
> 
> 
> 
> 
> _______________________________________________
> Lisp Hug - the mailing list for LispWorks users
> lisp-hug@lispworks.com
> http://www.lispworks.com/support/lisp-hug.html


_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html

Re: Functions named by keywords




On 24 Oct 2020, at 18:26, dbm@refined-audiometrics.com wrote:

I discovered similar abilities last week for FLET and LABELS. I hadn’t tried doing a direct DEFUN with a keyword name. But the spec just calls for a symbol, and a keyword is certainly a symbol. In my case there were advantages to allowing keywords to name LABELS functions in DLAMBDA-style (a-la Doug Comer). It enables one sub-function calling another directly using its key.

11.1.2.3 The KEYWORD Package

doesn't list any restriction on fbinding keywords.

You wouldn’t do that in a library, because of the collision risk, but it’s perfectly acceptable in end-user rc files.


-- 
__Pascal J. Bourguignon__

Re: Functions named by keywords

I agree with Pascal.  It is one of the consequences of CL being a 2-Lisp.

Having said that, please DO NOT DO IT!  IMHO, there are already way too many abuses of keywords when a proper symbol would be much more appropriate.

MA


On Sat, Oct 24, 2020 at 7:09 PM Pascal Bourguignon <pjb@informatimago.com> wrote:



On 24 Oct 2020, at 18:26, dbm@refined-audiometrics.com wrote:

I discovered similar abilities last week for FLET and LABELS. I hadn’t tried doing a direct DEFUN with a keyword name. But the spec just calls for a symbol, and a keyword is certainly a symbol. In my case there were advantages to allowing keywords to name LABELS functions in DLAMBDA-style (a-la Doug Comer). It enables one sub-function calling another directly using its key.

11.1.2.3 The KEYWORD Package

doesn't list any restriction on fbinding keywords.

You wouldn’t do that in a library, because of the collision risk, but it’s perfectly acceptable in end-user rc files.


-- 
__Pascal J. Bourguignon__



--
Marco Antoniotti, Associate Professor         tel. +39 - 02 64 48 79 01
DISCo, Università Milano Bicocca U14 2043 http://bimib.disco.unimib.it
Viale Sarca 336
I-20126 Milan (MI) ITALY

Re: Functions named by keywords

CL-USER 7 > *handle-warn-on-redefinition*
:WARN

CL-USER 8 > (defun :bar () :foo)
Warning: Defining function :BAR visible from package KEYWORD { *handle-warn-on-redefinition* is :WARN }
:BAR

CL-USER 9 > (:bar)
:FOO


> Am 24.10.2020 um 14:29 schrieb Michał phoe Herda <phoe@disroot.org>:
> 
> Hey!
> 
> Is there any technical limitation for why LispWorks does not allow for
> defining/calling functions named by keywords?
> 
> For instance, (defun :foo () 42) and then calling (:foo) seems to work
> as with any other symbols in all other implementations I have tested.
> 
> BR
> Michał "phoe" Herda
> 
> 
> 
> 
> _______________________________________________
> Lisp Hug - the mailing list for LispWorks users
> lisp-hug@lispworks.com
> http://www.lispworks.com/support/lisp-hug.html


_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html

Re: Functions named by keywords

> Is there any technical limitation for why LispWorks does not allow for
> defining/calling functions named by keywords?


It seems to work with LispWorks as well (albeit requiring *handle-warn-on-redefinition* set to :warn):

CL-USER 49 > (defun :b () 1)
Warning: Defining function :B visible from package KEYWORD { *handle-warn-on-redefinition* is :WARN }
:B

CL-USER 50 > (:b)
1





> 24 okt. 2020 kl. 14:29 skrev Michał phoe Herda <phoe@disroot.org>:
> 
> Hey!
> 
> Is there any technical limitation for why LispWorks does not allow for
> defining/calling functions named by keywords?
> 
> For instance, (defun :foo () 42) and then calling (:foo) seems to work
> as with any other symbols in all other implementations I have tested.
> 
> BR
> Michał "phoe" Herda
> 
> 
> 
> 
> _______________________________________________
> Lisp Hug - the mailing list for LispWorks users
> lisp-hug@lispworks.com
> http://www.lispworks.com/support/lisp-hug.html


_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html

Re: Functions named by keywords

Sorry for being obnoxious, but what part of USE-PACKAGE you don't like?

Just asking...

MA


On Sat, Oct 24, 2020 at 7:42 PM Wilfredo Velazquez <zulu.inuoe@gmail.com> wrote:
As mentioned prior, my sbclrc has various util functions bound in the keyword package since that makes them globally accessible (since I can't put them in CL).
While I'd never do this in a library (though https://github.com/danlentz/printv is a noteworthy exception), I see no reason to have this limitation in place any way or another.

On Sat, Oct 24, 2020 at 1:37 PM Rainer Joswig <joswig@lisp.de> wrote:
CL-USER 7 > *handle-warn-on-redefinition*
:WARN

CL-USER 8 > (defun :bar () :foo)
Warning: Defining function :BAR visible from package KEYWORD { *handle-warn-on-redefinition* is :WARN }
:BAR

CL-USER 9 > (:bar)
:FOO


> Am 24.10.2020 um 14:29 schrieb Michał phoe Herda <phoe@disroot.org>:
>
> Hey!
>
> Is there any technical limitation for why LispWorks does not allow for
> defining/calling functions named by keywords?
>
> For instance, (defun :foo () 42) and then calling (:foo) seems to work
> as with any other symbols in all other implementations I have tested.
>
> BR
> Michał "phoe" Herda
>
>
>
>
> _______________________________________________
> Lisp Hug - the mailing list for LispWorks users
> lisp-hug@lispworks.com
> http://www.lispworks.com/support/lisp-hug.html


_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


--
Wilfredo Velázquez-Rodríguez


--
Marco Antoniotti, Associate Professor         tel. +39 - 02 64 48 79 01
DISCo, Università Milano Bicocca U14 2043 http://bimib.disco.unimib.it
Viale Sarca 336
I-20126 Milan (MI) ITALY

Re: Functions named by keywords

LispWorks protects various packages by default against change.

KEYWORD is one of those.

> (system:package-flagged-p :keyword :implementation)
T

> *packages-for-warn-on-redefinition*
(:IMPLEMENTATION)

One can configure what happens when one changes the symbol: warn, error, quiet

Thus if one wants to use keyword symbols as function names, one needs to configure LispWorks to allow it.


The idea is that keywords have a single imported interface and thus various software can easily try to use the same keyword for global function bindings.




Am 24.10.2020 um 19:40 schrieb Wilfredo Velazquez <zulu.inuoe@gmail.com>:

As mentioned prior, my sbclrc has various util functions bound in the keyword package since that makes them globally accessible (since I can't put them in CL).
While I'd never do this in a library (though https://github.com/danlentz/printv is a noteworthy exception), I see no reason to have this limitation in place any way or another.

On Sat, Oct 24, 2020 at 1:37 PM Rainer Joswig <joswig@lisp.de> wrote:
CL-USER 7 > *handle-warn-on-redefinition*
:WARN

CL-USER 8 > (defun :bar () :foo)
Warning: Defining function :BAR visible from package KEYWORD { *handle-warn-on-redefinition* is :WARN }
:BAR

CL-USER 9 > (:bar)
:FOO


> Am 24.10.2020 um 14:29 schrieb Michał phoe Herda <phoe@disroot.org>:
>
> Hey!
>
> Is there any technical limitation for why LispWorks does not allow for
> defining/calling functions named by keywords?
>
> For instance, (defun :foo () 42) and then calling (:foo) seems to work
> as with any other symbols in all other implementations I have tested.
>
> BR
> Michał "phoe" Herda
>
>
>
>
> _______________________________________________
> Lisp Hug - the mailing list for LispWorks users
> lisp-hug@lispworks.com
> http://www.lispworks.com/support/lisp-hug.html


_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


--
Wilfredo Velázquez-Rodríguez

Re: Functions named by keywords

I meant 'have a single exported interface'

Am 24.10.2020 um 19:51 schrieb Rainer Joswig <joswig@lisp.de>:

LispWorks protects various packages by default against change.

KEYWORD is one of those.

> (system:package-flagged-p :keyword :implementation)
T

> *packages-for-warn-on-redefinition*
(:IMPLEMENTATION)

One can configure what happens when one changes the symbol: warn, error, quiet

Thus if one wants to use keyword symbols as function names, one needs to configure LispWorks to allow it.


The idea is that keywords have a single imported interface and thus various software can easily try to use the same keyword for global function bindings.




Am 24.10.2020 um 19:40 schrieb Wilfredo Velazquez <zulu.inuoe@gmail.com>:

As mentioned prior, my sbclrc has various util functions bound in the keyword package since that makes them globally accessible (since I can't put them in CL).
While I'd never do this in a library (though https://github.com/danlentz/printv is a noteworthy exception), I see no reason to have this limitation in place any way or another.

On Sat, Oct 24, 2020 at 1:37 PM Rainer Joswig <joswig@lisp.de> wrote:
CL-USER 7 > *handle-warn-on-redefinition*
:WARN

CL-USER 8 > (defun :bar () :foo)
Warning: Defining function :BAR visible from package KEYWORD { *handle-warn-on-redefinition* is :WARN }
:BAR

CL-USER 9 > (:bar)
:FOO


> Am 24.10.2020 um 14:29 schrieb Michał phoe Herda <phoe@disroot.org>:
>
> Hey!
>
> Is there any technical limitation for why LispWorks does not allow for
> defining/calling functions named by keywords?
>
> For instance, (defun :foo () 42) and then calling (:foo) seems to work
> as with any other symbols in all other implementations I have tested.
>
> BR
> Michał "phoe" Herda
>
>
>
>
> _______________________________________________
> Lisp Hug - the mailing list for LispWorks users
> lisp-hug@lispworks.com
> http://www.lispworks.com/support/lisp-hug.html


_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


--
Wilfredo Velázquez-Rodríguez


Re: Functions named by keywords

It's not about `use-package`, it's about being able to quickly call these functions regardless of what package my repl is in

On Sat, Oct 24, 2020 at 1:44 PM Marco Antoniotti <marco.antoniotti@unimib.it> wrote:
Sorry for being obnoxious, but what part of USE-PACKAGE you don't like?

Just asking...

MA


On Sat, Oct 24, 2020 at 7:42 PM Wilfredo Velazquez <zulu.inuoe@gmail.com> wrote:
As mentioned prior, my sbclrc has various util functions bound in the keyword package since that makes them globally accessible (since I can't put them in CL).
While I'd never do this in a library (though https://github.com/danlentz/printv is a noteworthy exception), I see no reason to have this limitation in place any way or another.

On Sat, Oct 24, 2020 at 1:37 PM Rainer Joswig <joswig@lisp.de> wrote:
CL-USER 7 > *handle-warn-on-redefinition*
:WARN

CL-USER 8 > (defun :bar () :foo)
Warning: Defining function :BAR visible from package KEYWORD { *handle-warn-on-redefinition* is :WARN }
:BAR

CL-USER 9 > (:bar)
:FOO


> Am 24.10.2020 um 14:29 schrieb Michał phoe Herda <phoe@disroot.org>:
>
> Hey!
>
> Is there any technical limitation for why LispWorks does not allow for
> defining/calling functions named by keywords?
>
> For instance, (defun :foo () 42) and then calling (:foo) seems to work
> as with any other symbols in all other implementations I have tested.
>
> BR
> Michał "phoe" Herda
>
>
>
>
> _______________________________________________
> Lisp Hug - the mailing list for LispWorks users
> lisp-hug@lispworks.com
> http://www.lispworks.com/support/lisp-hug.html


_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


--
Wilfredo Velázquez-Rodríguez


--
Marco Antoniotti, Associate Professor         tel. +39 - 02 64 48 79 01
DISCo, Università Milano Bicocca U14 2043 http://bimib.disco.unimib.it
Viale Sarca 336
I-20126 Milan (MI) ITALY


--
Wilfredo Velázquez-Rodríguez

Re: Functions named by keywords

I see. It seems it's also possible to disable that warning altogether.

CL-USER 2 > (setf *handle-warn-on-redefinition* nil)
NIL

CL-USER 3 > (defun :foo () 42)
:FOO

CL-USER 4 > (:foo)
42

Thanks for the heads-up.

~phoe

On 24.10.2020 19:39, Erik Ronström wrote:
>> Is there any technical limitation for why LispWorks does not allow for
>> defining/calling functions named by keywords?
>
> It seems to work with LispWorks as well (albeit requiring *handle-warn-on-redefinition* set to :warn):
>
> CL-USER 49 > (defun :b () 1)
> Warning: Defining function :B visible from package KEYWORD { *handle-warn-on-redefinition* is :WARN }
> :B
>
> CL-USER 50 > (:b)
> 1
>
>
>
>
>
>> 24 okt. 2020 kl. 14:29 skrev Michał phoe Herda <phoe@disroot.org>:
>>
>> Hey!
>>
>> Is there any technical limitation for why LispWorks does not allow for
>> defining/calling functions named by keywords?
>>
>> For instance, (defun :foo () 42) and then calling (:foo) seems to work
>> as with any other symbols in all other implementations I have tested.
>>
>> BR
>> Michał "phoe" Herda
>>
>>
>>
>>
>> _______________________________________________
>> Lisp Hug - the mailing list for LispWorks users
>> lisp-hug@lispworks.com
>> http://www.lispworks.com/support/lisp-hug.html

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html

Re: Functions named by keywords




On 24 Oct 2020, at 19:12, Marco Antoniotti <marco.antoniotti@unimib.it> wrote:

I agree with Pascal.  It is one of the consequences of CL being a 2-Lisp.

Having said that, please DO NOT DO IT!  IMHO, there are already way too many abuses of keywords when a proper symbol would be much more appropriate.


I think we may allow the end-user to fbind keywords for interactive commands.  
This let you implement REPL commands that are easily accessible from any package.

But of course, this is not something that you would do in library code, eg. code published on quicklisp.

Note that some CL (ccl, ecl) debuggers use keywords as commands (including function forms), because this allows them to read them using CL:READ whatever the current *PACKAGE*.

-- 
__Pascal J. Bourguignon__

Re: Functions named by keywords

for LispWorks see the documentation for system:define-top-loop-command


CL-USER 4 > (system:define-top-loop-command (:reverse-it (:result-type values))
                (&rest args)
              (reverse args))
(:REVERSE-IT)

CL-USER 5 > :reverse-it 1 2 3 4
(4 3 2 1)




Am 25.10.2020 um 09:19 schrieb Pascal Bourguignon <pjb@informatimago.com>:




On 24 Oct 2020, at 19:12, Marco Antoniotti <marco.antoniotti@unimib.it> wrote:

I agree with Pascal.  It is one of the consequences of CL being a 2-Lisp.

Having said that, please DO NOT DO IT!  IMHO, there are already way too many abuses of keywords when a proper symbol would be much more appropriate.


I think we may allow the end-user to fbind keywords for interactive commands.  
This let you implement REPL commands that are easily accessible from any package.

But of course, this is not something that you would do in library code, eg. code published on quicklisp.

Note that some CL (ccl, ecl) debuggers use keywords as commands (including function forms), because this allows them to read them using CL:READ whatever the current *PACKAGE*.

-- 
__Pascal J. Bourguignon__


Re: Functions named by keywords

I’m maybe remembering it wrong, but keyword should resolve to itself, defining it as a function will break this rule. It might break things i do not know about so i would avoid it and follow the rules. 

I’m just light user anyway so my response might be completely wrong. If this is the case, then please correct me.

Ladislav Koščo 
+421-949-49-36-36

On 25 Oct 2020, at 09:50, Rainer Joswig <joswig@lisp.de> wrote:

for LispWorks see the documentation for system:define-top-loop-command


CL-USER 4 > (system:define-top-loop-command (:reverse-it (:result-type values))
                (&rest args)
              (reverse args))
(:REVERSE-IT)

CL-USER 5 > :reverse-it 1 2 3 4
(4 3 2 1)




Am 25.10.2020 um 09:19 schrieb Pascal Bourguignon <pjb@informatimago.com>:




On 24 Oct 2020, at 19:12, Marco Antoniotti <marco.antoniotti@unimib.it> wrote:

I agree with Pascal.  It is one of the consequences of CL being a 2-Lisp.

Having said that, please DO NOT DO IT!  IMHO, there are already way too many abuses of keywords when a proper symbol would be much more appropriate.


I think we may allow the end-user to fbind keywords for interactive commands.  
This let you implement REPL commands that are easily accessible from any package.

But of course, this is not something that you would do in library code, eg. code published on quicklisp.

Note that some CL (ccl, ecl) debuggers use keywords as commands (including function forms), because this allows them to read them using CL:READ whatever the current *PACKAGE*.

-- 
__Pascal J. Bourguignon__


Re: Functions named by keywords

Keywords are constants in the variable namespace; binding them as functions binds them in the function namespace. You can try it in any other case, e.g. (DEFCONSTANT FOO 42) and then (DEFUN FOO () 24) and then (LIST FOO (FOO)).

On 25.10.2020 20:16, laci.kosco@gmail.com wrote:
I’m maybe remembering it wrong, but keyword should resolve to itself, defining it as a function will break this rule. It might break things i do not know about so i would avoid it and follow the rules. 

I’m just light user anyway so my response might be completely wrong. If this is the case, then please correct me.

Ladislav Koščo 
+421-949-49-36-36

On 25 Oct 2020, at 09:50, Rainer Joswig <joswig@lisp.de> wrote:

 for LispWorks see the documentation for system:define-top-loop-command


CL-USER 4 > (system:define-top-loop-command (:reverse-it (:result-type values))
                (&rest args)
              (reverse args))
(:REVERSE-IT)

CL-USER 5 > :reverse-it 1 2 3 4
(4 3 2 1)




Am 25.10.2020 um 09:19 schrieb Pascal Bourguignon <pjb@informatimago.com>:




On 24 Oct 2020, at 19:12, Marco Antoniotti <marco.antoniotti@unimib.it> wrote:

I agree with Pascal.  It is one of the consequences of CL being a 2-Lisp.

Having said that, please DO NOT DO IT!  IMHO, there are already way too many abuses of keywords when a proper symbol would be much more appropriate.


I think we may allow the end-user to fbind keywords for interactive commands.  
This let you implement REPL commands that are easily accessible from any package.

But of course, this is not something that you would do in library code, eg. code published on quicklisp.

Note that some CL (ccl, ecl) debuggers use keywords as commands (including function forms), because this allows them to read them using CL:READ whatever the current *PACKAGE*.

-- 
__Pascal J. Bourguignon__


Re: Functions named by keywords

[glossing over details ... ]

In CL, symbols are 2-tuples: {package, name}.

CL is a lisp2.  Symbols have a value and a function and ...

The Reader understands 2-tuple symbols {abc, xyz} when written with a double colon, e.g. abc::xyz.

When the compiler/interpreter sees a list, it interprets it as (<function> <val> <val> ...).  This is still just a list, it is the *compiler* which interprets the *meaning* of the list as "something more than a list".

When a symbol is in the <function> position, the compiler looks up the function value of the symbol.

When a symbol is in the <val> position, the compiler looks up the value of the symbol (which can be different from the function value of the symbol).

CL has a built-in shorthand for KEYWORD::xxx symbols.  The shorthand uses a single colon (not a double colon).  E.G. the reader expands :xxx to be KEYWORD::xxx (the 2-tuple {“KEYWORD", “xxx"}).

CL has another built-in shorthand for xxx symbols (i.e. no package name given, no colons at all).  The reader expands xxx to be <package>::xxx [where <package> is the current package, defined as the value of *package*].

DEFUN and DEFMETHOD take a bunch of args, the first one being a symbol (i.e. a 2-tuple symbol).

Usually, one uses the form (DEFUN xxx ...).  The reader expands this to mean (DEFUN <package>::xxx ...).

But, furthermore... E.G. I have added methods for classes by using:

(defmethod abc::xyz (...) ...)  [where abc is the package that the class symbol is in, and xyz is some new function/method that I want to add to the class]

So, it would not surprise me that keywords can be used in DEFUN and DEFMETHOD.  (In fact, DEFUN and DEFMETHOD are just 2-tuple symbols, too, but I don't want to go there :-).

Many non-CL Lisps are lisp1's, and use 1-tuple symbols (name only).  Many other languages don't have the concept of symbols and use various syntactic kludges to attack the packge problem.

pt


_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html

Re: Functions named by keywords



On 26 Oct 2020, at 00:51, paul tarvydas <paultarvydas@gmail.com> wrote:

[glossing over details ... ]

In CL, symbols are 2-tuples: {package, name}.

Not exactly.
1- symbols can have no home package (make-symbol “foo”) -> #:|foo|
2- symbols can be visible (via package use) or even present (via import) in several packages, so that CL-USER::PRINT. and CL:PRINT are the same symbol (granted, it would be (CL, PRINT), but see point 1.).

CL is a lisp2.  Symbols have a value and a function and ...

The Reader understands 2-tuple symbols {abc, xyz} when written with a double colon, e.g. abc::xyz.

Well, no. See point 2.

When the compiler/interpreter sees a list, it interprets it as (<function> <val> <val> ...).  This is still just a list, it is the *compiler* which interprets the *meaning* of the list as "something more than a list".

When a symbol is in the <function> position, the compiler looks up the function value of the symbol.

When a symbol is in the <val> position, the compiler looks up the value of the symbol (which can be different from the function value of the symbol).

CL has a built-in shorthand for KEYWORD::xxx symbols.  The shorthand uses a single colon (not a double colon).  E.G. the reader expands :xxx to be KEYWORD::xxx (the 2-tuple {“KEYWORD", “xxx"}).

Indeed, the pattern for tokens. ::aaaaa is undefined   (2.3.5).
Note however that all implementations intern in KEYWORD:

$ clall -r '::FOO'

Armed Bear Common Lisp         --> :|:FOO|
Clozure Common Lisp            --> :FOO
CLISP                          --> :FOO
ECL                            --> :FOO
SBCL                           --> :FOO



CL has another built-in shorthand for xxx symbols (i.e. no package name given, no colons at all).  The reader expands xxx to be <package>::xxx [where <package> is the current package, defined as the value of *package*].

DEFUN and DEFMETHOD take a bunch of args, the first one being a symbol (i.e. a 2-tuple symbol).

Usually, one uses the form (DEFUN xxx ...).  The reader expands this to mean (DEFUN <package>::xxx ...).

But, furthermore... E.G. I have added methods for classes by using:

(defmethod abc::xyz (...) ...)  [where abc is the package that the class symbol is in, and xyz is some new function/method that I want to add to the class]

So, it would not surprise me that keywords can be used in DEFUN and DEFMETHOD.  (In fact, DEFUN and DEFMETHOD are just 2-tuple symbols, too, but I don't want to go there :-).

Many non-CL Lisps are lisp1's, and use 1-tuple symbols (name only).  Many other languages don't have the concept of symbols and use various syntactic kludges to attack the packge problem.

-- 
__Pascal J. Bourguignon__


Updated at: 2020-12-10 08:28 UTC