Hi
I am trying to create a new ASDF:OPERATION, but I must be missing something and the manual (or Google) does not seem to help much.
How do you create a new operation, which may be quite simple? Or better, how do you get PERFORM and/or OPERATE to actually do something for you.
I know I should RTFM, but in this case it is more of a RTFC, which is far more difficult.
I tried the following
(defclass my-op (non-propagating-operation) ())
(defmethod perform ((o my-op) (s system)) (print 42))
(defmethod operate ((o my-op) (s system) &key &allow-other-keys) (print 666))
But then, doing
cl-user 42> (operate 'my-op (find-system "somesys") :bar 1024) #<MY-OP > #<ASDF/PLAN:SEQUENTIAL-PLAN 2301B97B>
is all I get.
Any tutorial or advice?
Thanks
Le 19/03/2021 à 18:58, Marco Antoniotti a écrit :
Hi
I am trying to create a new ASDF:OPERATION, but I must be missing something and the manual (or Google) does not seem to help much.
How do you create a new operation, which may be quite simple? Or better, how do you get PERFORM and/or OPERATE to actually do something for you.
I know I should RTFM, but in this case it is more of a RTFC, which is far more difficult.
I tried the following
(defclass my-op (non-propagating-operation) ())
(defmethod perform ((o my-op) (s system)) (print 42))
(defmethod operate ((o my-op) (s system) &key &allow-other-keys) (print 666))
But then, doing
cl-user 42> (operate 'my-op (find-system "somesys") :bar 1024) #<MY-OP > #<ASDF/PLAN:SEQUENTIAL-PLAN 2301B97B>
is all I get.
Any tutorial or advice?
If you don't override operate, then the inherited operate will call your overriden perform:
cl-user> (defclass my-op (non-propagating-operation) ())
(defmethod perform ((o my-op) (s system)) (print 42)) #<standard-method asdf/action:perform (my-op system) {1007690373}> cl-user> (operate 'my-op (find-system "cl-naive-store") :bar 1024)
42 #<my-op > #<sequential-plan {10076CDA23}> cl-user>
Alternatively, you may also override operate, but you need to call the next method (or use a :before or :after method:
cl-user> (defmethod operate ((o my-op) (s system) &rest keys &key &allow-other-keys) (print (list 666 keys)) (call-next-method o s)) #<standard-method asdf/operate:operate (my-op system) {10082AB6E3}>
cl-user> (operate 'my-op (find-system "xmls") :bar 1024) ; loading #P"/Users/pjb/quicklisp/dists/quicklisp/software/xmls-3.0.2/xmls.asd"
(666 (:bar 1024)) 42 #<my-op > #<sequential-plan {100857BF33}> cl-user> (operate 'my-op (find-system "xmls") :bar 1024)
(666 (:bar 1024)) #<my-op > #<sequential-plan {1002AFF8A3}> cl-user>
Note that default asdf:operate method registers that the perform method has been called on the system, so it doesn't call it again.
Hi. I'm happy to help you work through this, but so that it doesn't recur as a problem, I'd appreciate it if you would help me fix the manual's discussion of this.
First, have you read this page https://common-lisp.net/project/asdf/asdf.html#Creating-new-operations ?
Please have a look at that -- it's not very long -- and let us know what more needs to be supplied.
I note the discussion of `operation-done-p`. I suspect that is your problem -- your new operation is not aware that it needs to be performed.
This page is substantially redundant with the pages on the object model, and should be beefed up with cross-references, and more inclusion of docstrings...
On 19 Mar 2021, at 12:58, Marco Antoniotti wrote:
Hi
I am trying to create a new ASDF:OPERATION, but I must be missing something and the manual (or Google) does not seem to help much.
How do you create a new operation, which may be quite simple? Or better, how do you get PERFORM and/or OPERATE to actually do something for you.
I know I should RTFM, but in this case it is more of a RTFC, which is far more difficult.
I tried the following
(defclass my-op (non-propagating-operation) ())
(defmethod perform ((o my-op) (s system)) (print 42))
(defmethod operate ((o my-op) (s system) &key &allow-other-keys) (print 666))
But then, doing
cl-user 42> (operate 'my-op (find-system "somesys") :bar 1024) #<MY-OP > #<ASDF/PLAN:SEQUENTIAL-PLAN 2301B97B>
is all I get.
Any tutorial or advice?
Thanks
-- Marco Antoniotti, Associate Professor tel. +39 - 02 64 48 79 01 DISCo, Università Milano Bicocca U14 2043 http://dcb.disco.unimib.it Viale Sarca 336 I-20126 Milan (MI) ITALY
P.S. I don't recommend writing your own `OPERATE` methods -- `OPERATE` is quite complicated and messing with it could lead you into very deep water. I don't believe you should ever need to.
On 19 Mar 2021, at 13:42, Robert Goldman wrote:
Hi. I'm happy to help you work through this, but so that it doesn't recur as a problem, I'd appreciate it if you would help me fix the manual's discussion of this.
First, have you read this page https://common-lisp.net/project/asdf/asdf.html#Creating-new-operations ?
Please have a look at that -- it's not very long -- and let us know what more needs to be supplied.
I note the discussion of `operation-done-p`. I suspect that is your problem -- your new operation is not aware that it needs to be performed.
This page is substantially redundant with the pages on the object model, and should be beefed up with cross-references, and more inclusion of docstrings...
On 19 Mar 2021, at 12:58, Marco Antoniotti wrote:
Hi
I am trying to create a new ASDF:OPERATION, but I must be missing something and the manual (or Google) does not seem to help much.
How do you create a new operation, which may be quite simple? Or better, how do you get PERFORM and/or OPERATE to actually do something for you.
I know I should RTFM, but in this case it is more of a RTFC, which is far more difficult.
I tried the following
(defclass my-op (non-propagating-operation) ())
(defmethod perform ((o my-op) (s system)) (print 42))
(defmethod operate ((o my-op) (s system) &key &allow-other-keys) (print 666))
But then, doing
cl-user 42> (operate 'my-op (find-system "somesys") :bar 1024) #<MY-OP > #<ASDF/PLAN:SEQUENTIAL-PLAN 2301B97B>
is all I get.
Any tutorial or advice?
Thanks
-- Marco Antoniotti, Associate Professor tel. +39 - 02 64 48 79 01 DISCo, Università Milano Bicocca U14 2043 http://dcb.disco.unimib.it Viale Sarca 336 I-20126 Milan (MI) ITALY
BTW.
If you do not advise to specialize OPERATE, how do you pass arguments to PERFORM?
MA
On Fri, Mar 19, 2021 at 7:45 PM Robert Goldman rpgoldman@sift.info wrote:
P.S. I don't recommend writing your own OPERATE methods -- OPERATE is quite complicated and messing with it could lead you into very deep water. I don't believe you should ever need to.
On 19 Mar 2021, at 13:42, Robert Goldman wrote:
Hi. I'm happy to help you work through this, but so that it doesn't recur as a problem, I'd appreciate it if you would help me fix the manual's discussion of this.
First, have you read this page https://common-lisp.net/project/asdf/asdf.html#Creating-new-operations ?
Please have a look at that -- it's not very long -- and let us know what more needs to be supplied.
I note the discussion of operation-done-p. I suspect that is your problem -- your new operation is not aware that it needs to be performed.
This page is substantially redundant with the pages on the object model, and should be beefed up with cross-references, and more inclusion of docstrings...
On 19 Mar 2021, at 12:58, Marco Antoniotti wrote:
Hi
I am trying to create a new ASDF:OPERATION, but I must be missing something and the manual (or Google) does not seem to help much.
How do you create a new operation, which may be quite simple? Or better, how do you get PERFORM and/or OPERATE to actually do something for you.
I know I should RTFM, but in this case it is more of a RTFC, which is far more difficult.
I tried the following
(defclass my-op (non-propagating-operation) ())
(defmethod perform ((o my-op) (s system)) (print 42))
(defmethod operate ((o my-op) (s system) &key &allow-other-keys) (print 666))
But then, doing
cl-user 42> (operate 'my-op (find-system "somesys") :bar 1024) #<MY-OP > #<ASDF/PLAN:SEQUENTIAL-PLAN 2301B97B>
is all I get.
Any tutorial or advice?
Thanks
-- Marco Antoniotti, Associate Professor tel. +39 - 02 64 48 79 01 DISCo, Università Milano Bicocca U14 2043 http://dcb.disco.unimib.it Viale Sarca 336 I-20126 Milan (MI) ITALY
We don't actually. Faré deprecated that. The reasons are complicated, but basically, it wasn't possible to propagate arguments through a plan. What do you need an argument for? Maybe there's a work-around.
On 19 Mar 2021, at 16:24, Marco Antoniotti wrote:
BTW.
If you do not advise to specialize OPERATE, how do you pass arguments to PERFORM?
MA
On Fri, Mar 19, 2021 at 7:45 PM Robert Goldman rpgoldman@sift.info wrote:
P.S. I don't recommend writing your own OPERATE methods -- OPERATE is quite complicated and messing with it could lead you into very deep water. I don't believe you should ever need to.
On 19 Mar 2021, at 13:42, Robert Goldman wrote:
Hi. I'm happy to help you work through this, but so that it doesn't recur as a problem, I'd appreciate it if you would help me fix the manual's discussion of this.
First, have you read this page https://common-lisp.net/project/asdf/asdf.html#Creating-new-operations ?
Please have a look at that -- it's not very long -- and let us know what more needs to be supplied.
I note the discussion of operation-done-p. I suspect that is your problem -- your new operation is not aware that it needs to be performed.
This page is substantially redundant with the pages on the object model, and should be beefed up with cross-references, and more inclusion of docstrings...
On 19 Mar 2021, at 12:58, Marco Antoniotti wrote:
Hi
I am trying to create a new ASDF:OPERATION, but I must be missing something and the manual (or Google) does not seem to help much.
How do you create a new operation, which may be quite simple? Or better, how do you get PERFORM and/or OPERATE to actually do something for you.
I know I should RTFM, but in this case it is more of a RTFC, which is far more difficult.
I tried the following
(defclass my-op (non-propagating-operation) ())
(defmethod perform ((o my-op) (s system)) (print 42))
(defmethod operate ((o my-op) (s system) &key &allow-other-keys) (print 666))
But then, doing
cl-user 42> (operate 'my-op (find-system "somesys") :bar 1024) #<MY-OP > #<ASDF/PLAN:SEQUENTIAL-PLAN 2301B97B>
is all I get.
Any tutorial or advice?
Thanks
-- Marco Antoniotti, Associate Professor tel. +39 - 02 64 48 79 01 DISCo, Università Milano Bicocca U14 2043 http://dcb.disco.unimib.it Viale Sarca 336 I-20126 Milan (MI) ITALY
-- Marco Antoniotti, Associate Professor tel. +39 - 02 64 48 79 01 DISCo, Università Milano Bicocca U14 2043 http://dcb.disco.unimib.it Viale Sarca 336 I-20126 Milan (MI) ITALY
Ok.
Well, can you at least have a plist or something in the component specification? I presume yes. I am just allergic to RTFM as you know :)
Marco
On Sat, Mar 20, 2021 at 12:04 AM Robert Goldman rpgoldman@sift.info wrote:
We don't actually. Faré deprecated that. The reasons are complicated, but basically, it wasn't possible to propagate arguments through a plan. What do you need an argument for? Maybe there's a work-around.
On 19 Mar 2021, at 16:24, Marco Antoniotti wrote:
BTW.
If you do not advise to specialize OPERATE, how do you pass arguments to PERFORM?
MA
On Fri, Mar 19, 2021 at 7:45 PM Robert Goldman rpgoldman@sift.info wrote:
P.S. I don't recommend writing your own OPERATE methods -- OPERATE is quite complicated and messing with it could lead you into very deep water. I don't believe you should ever need to.
On 19 Mar 2021, at 13:42, Robert Goldman wrote:
Hi. I'm happy to help you work through this, but so that it doesn't recur as a problem, I'd appreciate it if you would help me fix the manual's discussion of this.
First, have you read this page https://common-lisp.net/project/asdf/asdf.html#Creating-new-operations ?
Please have a look at that -- it's not very long -- and let us know what more needs to be supplied.
I note the discussion of operation-done-p. I suspect that is your problem -- your new operation is not aware that it needs to be performed.
This page is substantially redundant with the pages on the object model, and should be beefed up with cross-references, and more inclusion of docstrings...
On 19 Mar 2021, at 12:58, Marco Antoniotti wrote:
Hi
I am trying to create a new ASDF:OPERATION, but I must be missing something and the manual (or Google) does not seem to help much.
How do you create a new operation, which may be quite simple? Or better, how do you get PERFORM and/or OPERATE to actually do something for you.
I know I should RTFM, but in this case it is more of a RTFC, which is far more difficult.
I tried the following
(defclass my-op (non-propagating-operation) ())
(defmethod perform ((o my-op) (s system)) (print 42))
(defmethod operate ((o my-op) (s system) &key &allow-other-keys) (print 666))
But then, doing
cl-user 42> (operate 'my-op (find-system "somesys") :bar 1024) #<MY-OP > #<ASDF/PLAN:SEQUENTIAL-PLAN 2301B97B>
is all I get.
Any tutorial or advice?
Thanks
-- Marco Antoniotti, Associate Professor tel. +39 - 02 64 48 79 01 DISCo, Università Milano Bicocca U14 2043 http://dcb.disco.unimib.it Viale Sarca 336 I-20126 Milan (MI) ITALY
-- Marco Antoniotti, Associate Professor tel. +39 - 02 64 48 79 01 DISCo, Università Milano Bicocca U14 2043 http://dcb.disco.unimib.it Viale Sarca 336 I-20126 Milan (MI) ITALY
Yes, if you look at FIVEAM-ASDF, that is how John Maraist and I do it. We introduce a subclass of systems that has an extra slot holding the list of tests to be performed, and PERFORM reads that slot when doing TEST-OP.
-- Robert P. Goldman
On March 20, 2021 at 02:45:57, Marco Antoniotti (marco.antoniotti@unimib.it(mailto:marco.antoniotti@unimib.it)) wrote:
Ok.
Well, can you at least have a plist or something in the component specification? I presume yes. I am just allergic to RTFM as you know :)
Marco
On Sat, Mar 20, 2021 at 12:04 AM Robert Goldman <rpgoldman@sift.info(mailto:rpgoldman@sift.info)> wrote:
We don't actually. Faré deprecated that. The reasons are complicated, but basically, it wasn't possible to propagate arguments through a plan. What do you need an argument for? Maybe there's a work-around.
On 19 Mar 2021, at 16:24, Marco Antoniotti wrote:
BTW.
If you do not advise to specialize OPERATE, how do you pass arguments to PERFORM?
MA
On Fri, Mar 19, 2021 at 7:45 PM Robert Goldman <rpgoldman@sift.info(mailto:rpgoldman@sift.info)> wrote:
P.S. I don't recommend writing your own OPERATE methods -- OPERATE is quite complicated and messing with it could lead you into very deep water. I don't believe you should ever need to.
On 19 Mar 2021, at 13:42, Robert Goldman wrote:
Hi. I'm happy to help you work through this, but so that it doesn't recur as a problem, I'd appreciate it if you would help me fix the manual's discussion of this.
First, have you read this page https://common-lisp.net/project/asdf/asdf.html#Creating-new-operations ?
Please have a look at that -- it's not very long -- and let us know what more needs to be supplied.
I note the discussion of operation-done-p. I suspect that is your problem -- your new operation is not aware that it needs to be performed.
This page is substantially redundant with the pages on the object model, and should be beefed up with cross-references, and more inclusion of docstrings...
On 19 Mar 2021, at 12:58, Marco Antoniotti wrote:
Hi
I am trying to create a new ASDF:OPERATION, but I must be missing something and the manual (or Google) does not seem to help much.
How do you create a new operation, which may be quite simple? Or better, how do you get PERFORM and/or OPERATE to actually do something for you.
I know I should RTFM, but in this case it is more of a RTFC, which is far more difficult.
I tried the following
(defclass my-op (non-propagating-operation) ())
(defmethod perform ((o my-op) (s system)) (print 42))
(defmethod operate ((o my-op) (s system) &key &allow-other-keys) (print 666))
But then, doing
cl-user 42> (operate 'my-op (find-system "somesys") :bar 1024) #<MY-OP > #<ASDF/PLAN:SEQUENTIAL-PLAN 2301B97B>
is all I get.
Any tutorial or advice?
Thanks
-- Marco Antoniotti, Associate Professor tel. +39 - 02 64 48 79 01 DISCo, Università Milano Bicocca U14 2043 http://dcb.disco.unimib.it(http://dcb.disco.unimib.it/) Viale Sarca 336 I-20126 Milan (MI) ITALY
-- Marco Antoniotti, Associate Professor tel. +39 - 02 64 48 79 01 DISCo, Università Milano Bicocca U14 2043 http://dcb.disco.unimib.it(http://dcb.disco.unimib.it/) Viale Sarca 336 I-20126 Milan (MI) ITALY
-- Marco Antoniotti, Associate Professor tel. +39 - 02 64 48 79 01 DISCo, Università Milano Bicocca U14 2043 http://dcb.disco.unimib.it(http://dcb.disco.unimib.it/) Viale Sarca 336 I-20126 Milan (MI) ITALY
Cool, thanks!
Turns out that just using :properties in the system definition works.
Check out (within parens...): HEΛPing ASDF (within-parens.blogspot.com) https://within-parens.blogspot.com/2021/03/he-asdf.html
Cheers
Marco
On Sat, Mar 20, 2021 at 2:41 PM Robert P. Goldman rpgoldman@sift.net wrote:
Yes, if you look at FIVEAM-ASDF, that is how John Maraist and I do it. We introduce a subclass of systems that has an extra slot holding the list of tests to be performed, and PERFORM reads that slot when doing TEST-OP.
-- Robert P. Goldman
On March 20, 2021 at 02:45:57, Marco Antoniotti ( marco.antoniotti@unimib.it) wrote:
Ok.
Well, can you at least have a plist or something in the component specification? I presume yes. I am just allergic to RTFM as you know :)
Marco
On Sat, Mar 20, 2021 at 12:04 AM Robert Goldman rpgoldman@sift.info wrote:
We don't actually. Faré deprecated that. The reasons are complicated, but basically, it wasn't possible to propagate arguments through a plan. What do you need an argument for? Maybe there's a work-around.
On 19 Mar 2021, at 16:24, Marco Antoniotti wrote:
BTW.
If you do not advise to specialize OPERATE, how do you pass arguments to PERFORM?
MA
On Fri, Mar 19, 2021 at 7:45 PM Robert Goldman rpgoldman@sift.info wrote:
P.S. I don't recommend writing your own OPERATE methods -- OPERATE is quite complicated and messing with it could lead you into very deep water. I don't believe you should ever need to.
On 19 Mar 2021, at 13:42, Robert Goldman wrote:
Hi. I'm happy to help you work through this, but so that it doesn't recur as a problem, I'd appreciate it if you would help me fix the manual's discussion of this.
First, have you read this page https://common-lisp.net/project/asdf/asdf.html#Creating-new-operations ?
Please have a look at that -- it's not very long -- and let us know what more needs to be supplied.
I note the discussion of operation-done-p. I suspect that is your problem -- your new operation is not aware that it needs to be performed.
This page is substantially redundant with the pages on the object model, and should be beefed up with cross-references, and more inclusion of docstrings...
On 19 Mar 2021, at 12:58, Marco Antoniotti wrote:
Hi
I am trying to create a new ASDF:OPERATION, but I must be missing something and the manual (or Google) does not seem to help much.
How do you create a new operation, which may be quite simple? Or better, how do you get PERFORM and/or OPERATE to actually do something for you.
I know I should RTFM, but in this case it is more of a RTFC, which is far more difficult.
I tried the following
(defclass my-op (non-propagating-operation) ())
(defmethod perform ((o my-op) (s system)) (print 42))
(defmethod operate ((o my-op) (s system) &key &allow-other-keys) (print 666))
But then, doing
cl-user 42> (operate 'my-op (find-system "somesys") :bar 1024) #<MY-OP > #<ASDF/PLAN:SEQUENTIAL-PLAN 2301B97B>
is all I get.
Any tutorial or advice?
Thanks
-- Marco Antoniotti, Associate Professor tel. +39 - 02 64 48 79 01 DISCo, Università Milano Bicocca U14 2043 http://dcb.disco.unimib.it Viale Sarca 336 I-20126 Milan (MI) ITALY
-- Marco Antoniotti, Associate Professor tel. +39 - 02 64 48 79 01 DISCo, Università Milano Bicocca U14 2043 http://dcb.disco.unimib.it Viale Sarca 336 I-20126 Milan (MI) ITALY
-- Marco Antoniotti, Associate Professor tel. +39 - 02 64 48 79 01 DISCo, Università Milano Bicocca U14 2043 http://dcb.disco.unimib.it Viale Sarca 336 I-20126 Milan (MI) ITALY
Neat! Thanks for posting the pointer! BTW, you might want to change the name from :properties to something like :doc-properties to avoid potential name collisions...
-- Robert P. Goldman
On March 20, 2021 at 09:11:45, Marco Antoniotti (marco.antoniotti@unimib.it(mailto:marco.antoniotti@unimib.it)) wrote:
Cool, thanks!
Turns out that just using :properties in the system definition works.
Check out (within parens...): HEΛPing ASDF (within-parens.blogspot.com)(https://within-parens.blogspot.com/2021/03/he-asdf.html)
Cheers
Marco
On Sat, Mar 20, 2021 at 2:41 PM Robert P. Goldman <rpgoldman@sift.net(mailto:rpgoldman@sift.net)> wrote:
Yes, if you look at FIVEAM-ASDF, that is how John Maraist and I do it. We introduce a subclass of systems that has an extra slot holding the list of tests to be performed, and PERFORM reads that slot when doing TEST-OP.
-- Robert P. Goldman
On March 20, 2021 at 02:45:57, Marco Antoniotti (marco.antoniotti@unimib.it(mailto:marco.antoniotti@unimib.it)) wrote:
Ok.
Well, can you at least have a plist or something in the component specification? I presume yes. I am just allergic to RTFM as you know :)
Marco
On Sat, Mar 20, 2021 at 12:04 AM Robert Goldman <rpgoldman@sift.info(mailto:rpgoldman@sift.info)> wrote:
We don't actually. Faré deprecated that. The reasons are complicated, but basically, it wasn't possible to propagate arguments through a plan. What do you need an argument for? Maybe there's a work-around.
On 19 Mar 2021, at 16:24, Marco Antoniotti wrote:
BTW.
If you do not advise to specialize OPERATE, how do you pass arguments to PERFORM?
MA
On Fri, Mar 19, 2021 at 7:45 PM Robert Goldman <rpgoldman@sift.info(mailto:rpgoldman@sift.info)> wrote:
P.S. I don't recommend writing your own OPERATE methods -- OPERATE is quite complicated and messing with it could lead you into very deep water. I don't believe you should ever need to.
On 19 Mar 2021, at 13:42, Robert Goldman wrote:
> > Hi. I'm happy to help you work through this, but so that it doesn't recur as a problem, I'd appreciate it if you would help me fix the manual's discussion of this. > > > First, have you read this page https://common-lisp.net/project/asdf/asdf.html#Creating-new-operations ? > > > Please have a look at that -- it's not very long -- and let us know what more needs to be supplied. > > > I note the discussion of operation-done-p. I suspect that is your problem -- your new operation is not aware that it needs to be performed. > > > This page is substantially redundant with the pages on the object model, and should be beefed up with cross-references, and more inclusion of docstrings... > > > On 19 Mar 2021, at 12:58, Marco Antoniotti wrote: > > > > > Hi > > > > I am trying to create a new ASDF:OPERATION, but I must be missing something and the manual (or Google) does not seem to help much. > > > > How do you create a new operation, which may be quite simple? Or better, how do you get PERFORM and/or OPERATE to actually do something for you. > > > > I know I should RTFM, but in this case it is more of a RTFC, which is far more difficult. > > > > I tried the following > > > > (defclass my-op (non-propagating-operation) ()) > > > > (defmethod perform ((o my-op) (s system)) > > (print 42)) > > > > (defmethod operate ((o my-op) (s system) &key &allow-other-keys) > > (print 666)) > > > > But then, doing > > > > cl-user 42> (operate 'my-op (find-system "somesys") :bar 1024) > > #<MY-OP > > > #<ASDF/PLAN:SEQUENTIAL-PLAN 2301B97B> > > > > is all I get. > > > > Any tutorial or advice? > > > > Thanks > > > > -- > > Marco Antoniotti, Associate Professor tel. +39 - 02 64 48 79 01 > > DISCo, Università Milano Bicocca U14 2043 http://dcb.disco.unimib.it(http://dcb.disco.unimib.it/) > > Viale Sarca 336 > > I-20126 Milan (MI) ITALY
-- Marco Antoniotti, Associate Professor tel. +39 - 02 64 48 79 01 DISCo, Università Milano Bicocca U14 2043 http://dcb.disco.unimib.it(http://dcb.disco.unimib.it/) Viale Sarca 336 I-20126 Milan (MI) ITALY
-- Marco Antoniotti, Associate Professor tel. +39 - 02 64 48 79 01 DISCo, Università Milano Bicocca U14 2043 http://dcb.disco.unimib.it(http://dcb.disco.unimib.it/) Viale Sarca 336 I-20126 Milan (MI) ITALY
-- Marco Antoniotti, Associate Professor tel. +39 - 02 64 48 79 01 DISCo, Università Milano Bicocca U14 2043 http://dcb.disco.unimib.it(http://dcb.disco.unimib.it/) Viale Sarca 336 I-20126 Milan (MI) ITALY
Hi Robert
isn't :properties a kitchen sink for "plist" stuff? Just using it does not require subclassing ASDF:SYSTEM, but I see that there may be some issues. I guess I can come up with something different.
All the best
Marco
On Sat, Mar 20, 2021 at 3:19 PM Robert P. Goldman rpgoldman@sift.net wrote:
Neat! Thanks for posting the pointer! BTW, you might want to change the name from :properties to something like :doc-properties to avoid potential name collisions...
-- Robert P. Goldman
On March 20, 2021 at 09:11:45, Marco Antoniotti ( marco.antoniotti@unimib.it) wrote:
Cool, thanks!
Turns out that just using :properties in the system definition works.
Check out (within parens...): HEΛPing ASDF (within-parens.blogspot.com) https://within-parens.blogspot.com/2021/03/he-asdf.html
Cheers
Marco
On Sat, Mar 20, 2021 at 2:41 PM Robert P. Goldman rpgoldman@sift.net wrote:
Yes, if you look at FIVEAM-ASDF, that is how John Maraist and I do it. We introduce a subclass of systems that has an extra slot holding the list of tests to be performed, and PERFORM reads that slot when doing TEST-OP.
-- Robert P. Goldman
On March 20, 2021 at 02:45:57, Marco Antoniotti ( marco.antoniotti@unimib.it) wrote:
Ok.
Well, can you at least have a plist or something in the component specification? I presume yes. I am just allergic to RTFM as you know :)
Marco
On Sat, Mar 20, 2021 at 12:04 AM Robert Goldman rpgoldman@sift.info wrote:
We don't actually. Faré deprecated that. The reasons are complicated, but basically, it wasn't possible to propagate arguments through a plan. What do you need an argument for? Maybe there's a work-around.
On 19 Mar 2021, at 16:24, Marco Antoniotti wrote:
BTW.
If you do not advise to specialize OPERATE, how do you pass arguments to PERFORM?
MA
On Fri, Mar 19, 2021 at 7:45 PM Robert Goldman rpgoldman@sift.info wrote:
P.S. I don't recommend writing your own OPERATE methods -- OPERATE is quite complicated and messing with it could lead you into very deep water. I don't believe you should ever need to.
On 19 Mar 2021, at 13:42, Robert Goldman wrote:
Hi. I'm happy to help you work through this, but so that it doesn't recur as a problem, I'd appreciate it if you would help me fix the manual's discussion of this.
First, have you read this page https://common-lisp.net/project/asdf/asdf.html#Creating-new-operations ?
Please have a look at that -- it's not very long -- and let us know what more needs to be supplied.
I note the discussion of operation-done-p. I suspect that is your problem -- your new operation is not aware that it needs to be performed.
This page is substantially redundant with the pages on the object model, and should be beefed up with cross-references, and more inclusion of docstrings...
On 19 Mar 2021, at 12:58, Marco Antoniotti wrote:
Hi
I am trying to create a new ASDF:OPERATION, but I must be missing something and the manual (or Google) does not seem to help much.
How do you create a new operation, which may be quite simple? Or better, how do you get PERFORM and/or OPERATE to actually do something for you.
I know I should RTFM, but in this case it is more of a RTFC, which is far more difficult.
I tried the following
(defclass my-op (non-propagating-operation) ())
(defmethod perform ((o my-op) (s system)) (print 42))
(defmethod operate ((o my-op) (s system) &key &allow-other-keys) (print 666))
But then, doing
cl-user 42> (operate 'my-op (find-system "somesys") :bar 1024) #<MY-OP > #<ASDF/PLAN:SEQUENTIAL-PLAN 2301B97B>
is all I get.
Any tutorial or advice?
Thanks
-- Marco Antoniotti, Associate Professor tel. +39 - 02 64 48 79 01 DISCo, Università Milano Bicocca U14 2043 http://dcb.disco.unimib.it Viale Sarca 336 I-20126 Milan (MI) ITALY
-- Marco Antoniotti, Associate Professor tel. +39 - 02 64 48 79 01 DISCo, Università Milano Bicocca U14 2043 http://dcb.disco.unimib.it Viale Sarca 336 I-20126 Milan (MI) ITALY
-- Marco Antoniotti, Associate Professor tel. +39 - 02 64 48 79 01 DISCo, Università Milano Bicocca U14 2043 http://dcb.disco.unimib.it Viale Sarca 336 I-20126 Milan (MI) ITALY
-- Marco Antoniotti, Associate Professor tel. +39 - 02 64 48 79 01 DISCo, Università Milano Bicocca U14 2043 http://dcb.disco.unimib.it Viale Sarca 336 I-20126 Milan (MI) ITALY
Oh, yes, you are right about :properties. I had forgotten. I generally add my own dedicated slot, but :properties is probably fine.
-- Robert P. Goldman
On March 20, 2021 at 09:23:21, Marco Antoniotti (marco.antoniotti@unimib.it(mailto:marco.antoniotti@unimib.it)) wrote:
Hi Robert
isn't :properties a kitchen sink for "plist" stuff? Just using it does not require subclassing ASDF:SYSTEM, but I see that there may be some issues. I guess I can come up with something different.
All the best
Marco
On Sat, Mar 20, 2021 at 3:19 PM Robert P. Goldman <rpgoldman@sift.net(mailto:rpgoldman@sift.net)> wrote:
Neat! Thanks for posting the pointer! BTW, you might want to change the name from :properties to something like :doc-properties to avoid potential name collisions...
-- Robert P. Goldman
On March 20, 2021 at 09:11:45, Marco Antoniotti (marco.antoniotti@unimib.it(mailto:marco.antoniotti@unimib.it)) wrote:
Cool, thanks!
Turns out that just using :properties in the system definition works.
Check out (within parens...): HEΛPing ASDF (within-parens.blogspot.com)(https://within-parens.blogspot.com/2021/03/he-asdf.html)
Cheers
Marco
On Sat, Mar 20, 2021 at 2:41 PM Robert P. Goldman <rpgoldman@sift.net(mailto:rpgoldman@sift.net)> wrote:
Yes, if you look at FIVEAM-ASDF, that is how John Maraist and I do it. We introduce a subclass of systems that has an extra slot holding the list of tests to be performed, and PERFORM reads that slot when doing TEST-OP.
-- Robert P. Goldman
On March 20, 2021 at 02:45:57, Marco Antoniotti (marco.antoniotti@unimib.it(mailto:marco.antoniotti@unimib.it)) wrote:
Ok.
Well, can you at least have a plist or something in the component specification? I presume yes. I am just allergic to RTFM as you know :)
Marco
On Sat, Mar 20, 2021 at 12:04 AM Robert Goldman <rpgoldman@sift.info(mailto:rpgoldman@sift.info)> wrote:
We don't actually. Faré deprecated that. The reasons are complicated, but basically, it wasn't possible to propagate arguments through a plan. What do you need an argument for? Maybe there's a work-around.
On 19 Mar 2021, at 16:24, Marco Antoniotti wrote:
> BTW. > > If you do not advise to specialize OPERATE, how do you pass arguments to PERFORM? > > MA > > On Fri, Mar 19, 2021 at 7:45 PM Robert Goldman <rpgoldman@sift.info(mailto:rpgoldman@sift.info)> wrote: > > > > P.S. I don't recommend writing your own OPERATE methods -- OPERATE is quite complicated and messing with it could lead you into very deep water. I don't believe you should ever need to. > > > > > > On 19 Mar 2021, at 13:42, Robert Goldman wrote: > > > > > > > > > > > > Hi. I'm happy to help you work through this, but so that it doesn't recur as a problem, I'd appreciate it if you would help me fix the manual's discussion of this. > > > > > > > > > First, have you read this page https://common-lisp.net/project/asdf/asdf.html#Creating-new-operations ? > > > > > > > > > Please have a look at that -- it's not very long -- and let us know what more needs to be supplied. > > > > > > > > > I note the discussion of operation-done-p. I suspect that is your problem -- your new operation is not aware that it needs to be performed. > > > > > > > > > This page is substantially redundant with the pages on the object model, and should be beefed up with cross-references, and more inclusion of docstrings... > > > > > > > > > On 19 Mar 2021, at 12:58, Marco Antoniotti wrote: > > > > > > > > > > > > > Hi > > > > > > > > I am trying to create a new ASDF:OPERATION, but I must be missing something and the manual (or Google) does not seem to help much. > > > > > > > > How do you create a new operation, which may be quite simple? Or better, how do you get PERFORM and/or OPERATE to actually do something for you. > > > > > > > > I know I should RTFM, but in this case it is more of a RTFC, which is far more difficult. > > > > > > > > I tried the following > > > > > > > > (defclass my-op (non-propagating-operation) ()) > > > > > > > > (defmethod perform ((o my-op) (s system)) > > > > (print 42)) > > > > > > > > (defmethod operate ((o my-op) (s system) &key &allow-other-keys) > > > > (print 666)) > > > > > > > > But then, doing > > > > > > > > cl-user 42> (operate 'my-op (find-system "somesys") :bar 1024) > > > > #<MY-OP > > > > > #<ASDF/PLAN:SEQUENTIAL-PLAN 2301B97B> > > > > > > > > is all I get. > > > > > > > > Any tutorial or advice? > > > > > > > > Thanks > > > > > > > > -- > > > > Marco Antoniotti, Associate Professor tel. +39 - 02 64 48 79 01 > > > > DISCo, Università Milano Bicocca U14 2043 http://dcb.disco.unimib.it(http://dcb.disco.unimib.it/) > > > > Viale Sarca 336 > > > > I-20126 Milan (MI) ITALY > > > -- > Marco Antoniotti, Associate Professor tel. +39 - 02 64 48 79 01 > DISCo, Università Milano Bicocca U14 2043 http://dcb.disco.unimib.it(http://dcb.disco.unimib.it/) > Viale Sarca 336 > I-20126 Milan (MI) ITALY
-- Marco Antoniotti, Associate Professor tel. +39 - 02 64 48 79 01 DISCo, Università Milano Bicocca U14 2043 http://dcb.disco.unimib.it(http://dcb.disco.unimib.it/) Viale Sarca 336 I-20126 Milan (MI) ITALY
-- Marco Antoniotti, Associate Professor tel. +39 - 02 64 48 79 01 DISCo, Università Milano Bicocca U14 2043 http://dcb.disco.unimib.it(http://dcb.disco.unimib.it/) Viale Sarca 336 I-20126 Milan (MI) ITALY
-- Marco Antoniotti, Associate Professor tel. +39 - 02 64 48 79 01 DISCo, Università Milano Bicocca U14 2043 http://dcb.disco.unimib.it(http://dcb.disco.unimib.it/) Viale Sarca 336 I-20126 Milan (MI) ITALY
Thanks Robert.
AFAIAC the operation-done-p did the trick. I had skipped it as the doc says that this operation "may" be provided.
I am not sure how to improve the docs for this task (creating new operations). I guess a description of what OPERATE and PERFORM actually invoke and when would help.
All the best
Marco
On Fri, Mar 19, 2021 at 7:42 PM Robert Goldman rpgoldman@sift.info wrote:
Hi. I'm happy to help you work through this, but so that it doesn't recur as a problem, I'd appreciate it if you would help me fix the manual's discussion of this.
First, have you read this page https://common-lisp.net/project/asdf/asdf.html#Creating-new-operations ?
Please have a look at that -- it's not very long -- and let us know what more needs to be supplied.
I note the discussion of operation-done-p. I suspect that is your problem -- your new operation is not aware that it needs to be performed.
This page is substantially redundant with the pages on the object model, and should be beefed up with cross-references, and more inclusion of docstrings...
On 19 Mar 2021, at 12:58, Marco Antoniotti wrote:
Hi
I am trying to create a new ASDF:OPERATION, but I must be missing something and the manual (or Google) does not seem to help much.
How do you create a new operation, which may be quite simple? Or better, how do you get PERFORM and/or OPERATE to actually do something for you.
I know I should RTFM, but in this case it is more of a RTFC, which is far more difficult.
I tried the following
(defclass my-op (non-propagating-operation) ())
(defmethod perform ((o my-op) (s system)) (print 42))
(defmethod operate ((o my-op) (s system) &key &allow-other-keys) (print 666))
But then, doing
cl-user 42> (operate 'my-op (find-system "somesys") :bar 1024) #<MY-OP > #<ASDF/PLAN:SEQUENTIAL-PLAN 2301B97B>
is all I get.
Any tutorial or advice?
Thanks
-- Marco Antoniotti, Associate Professor tel. +39 - 02 64 48 79 01 DISCo, Università Milano Bicocca U14 2043 http://dcb.disco.unimib.it Viale Sarca 336 I-20126 Milan (MI) ITALY