bug in latest Language/rdl.lisp

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

bug in latest Language/rdl.lisp

Jim Prewett

Hi all,

I've found a bug in the RDL code; I've not had a chance to find it yet.

However, a rule that is created using the RDL without specifying a name
throws an error as it tries to evaluate the symbol that is generated (that
symbol should be used as the name).

Under CMUCL 19 C, I get this for the simplest case (a new rule with no
match, actions, etc. specified)

* (rule)


Error in KERNEL::UNBOUND-SYMBOL-ERROR-HANDLER:  the variable #:NAME2396 is
unbound.
   [Condition of type UNBOUND-VARIABLE]

Restarts:
  0: [ABORT] Return to Top-Level.

Debug  (type H for help)

(EVAL #:NAME2396)

Jim


James E. Prewett                    [hidden email] [hidden email]
Systems Team Leader           LoGS: http://www.hpc.unm.edu/~download/LoGS/ 
Designated Security Officer         OpenPGP key: pub 1024D/31816D93    
HPC Systems Engineer III   UNM HPC  505.277.8210


_______________________________________________
LoGS-devel mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/logs-devel
Reply | Threaded
Open this post in threaded view
|

Re: bug in latest Language/rdl.lisp

Jim Prewett

I just committed a minor change to rdl.lisp; now, instead of letting the
RDL code come up with the name of an unnamed rule, I leave that to the
make-instance method in the :LoGS package for the RULE class.

I can see where you, Vijay, were going with it, I just can't figure out
how to quote that name if it is a symbol rather than trying to evaluate
it.  I'm open to other suggestions :)

All tests pass again with this (minor) change.

Jim

James E. Prewett                    [hidden email] [hidden email]
Systems Team Leader           LoGS: http://www.hpc.unm.edu/~download/LoGS/ 
Designated Security Officer         OpenPGP key: pub 1024D/31816D93    
HPC Systems Engineer III   UNM HPC  505.277.8210

On Thu, 3 Aug 2006, Jim Prewett wrote:

>
> Hi all,
>
> I've found a bug in the RDL code; I've not had a chance to find it yet.
>
> However, a rule that is created using the RDL without specifying a name
> throws an error as it tries to evaluate the symbol that is generated (that
> symbol should be used as the name).
>
> Under CMUCL 19 C, I get this for the simplest case (a new rule with no
> match, actions, etc. specified)
>
> * (rule)
>
>
> Error in KERNEL::UNBOUND-SYMBOL-ERROR-HANDLER:  the variable #:NAME2396 is
> unbound.
>    [Condition of type UNBOUND-VARIABLE]
>
> Restarts:
>   0: [ABORT] Return to Top-Level.
>
> Debug  (type H for help)
>
> (EVAL #:NAME2396)
>
> Jim
>
>
> James E. Prewett                    [hidden email] [hidden email]
> Systems Team Leader           LoGS: http://www.hpc.unm.edu/~download/LoGS/ 
> Designated Security Officer         OpenPGP key: pub 1024D/31816D93    
> HPC Systems Engineer III   UNM HPC  505.277.8210
>
>
> _______________________________________________
> LoGS-devel mailing list
> [hidden email]
> http://lists.nongnu.org/mailman/listinfo/logs-devel
>


_______________________________________________
LoGS-devel mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/logs-devel
Reply | Threaded
Open this post in threaded view
|

Re: bug in latest Language/rdl.lisp

Vijay Lakshminarayanan
On 8/3/06, Jim Prewett <[hidden email]> wrote:
>
> I just committed a minor change to rdl.lisp; now, instead of letting the
> RDL code come up with the name of an unnamed rule, I leave that to the
> make-instance method in the :LoGS package for the RULE class.
>
> I can see where you, Vijay, were going with it, I just can't figure out
> how to quote that name if it is a symbol rather than trying to evaluate
> it.  I'm open to other suggestions :)

LANGUAGE> (let ((name 'rule-name))
            (rule named name))
#<RULE name: RULE-NAME match: NIL delete-rule: NIL continuep: NIL
actions: NIL environment: NIL  match-count: 0  match-try: 0 {AE40551}>

LANGUAGE> (let ((name 'rule-name))
            (rule named 'name))
[warnings deleted]
#<RULE name: NAME match: NIL delete-rule: NIL continuep: NIL actions:
NIL environment: NIL  match-count: 0  match-try: 0 {AF54D81}>

However, I prefer your current change.  It makes more sense to
delegate the work to make-instance when we don't know the default
since it reduces the number of places where we must update our changes
(something RDL in general suffers from :-)

The problem was, as you noted, I'd forgotten to quote the gensym which
resulted in the enviomnent evaluating a freshly interned symbol
#:NAME1245.  This is a lesson to me that I must once in a while try to
evaluate also, rather than just macroexpand-1'ing :-)

(defmethod get-rule-slot ((rule rule-macro) (slot (eql :name)))
  (declare (ignore slot))
  (or (rule-macro-name rule) `',(gensym "NAME")))

would have fixed it but I think you made the right choice to remove it.

> All tests pass again with this (minor) change.
>
> Jim
>
> James E. Prewett                    [hidden email] [hidden email]
> Systems Team Leader           LoGS: http://www.hpc.unm.edu/~download/LoGS/
> Designated Security Officer         OpenPGP key: pub 1024D/31816D93
> HPC Systems Engineer III   UNM HPC  505.277.8210
>
> On Thu, 3 Aug 2006, Jim Prewett wrote:
>
> >
> > Hi all,
> >
> > I've found a bug in the RDL code; I've not had a chance to find it yet.
> >
> > However, a rule that is created using the RDL without specifying a name
> > throws an error as it tries to evaluate the symbol that is generated (that
> > symbol should be used as the name).
> >
> > Under CMUCL 19 C, I get this for the simplest case (a new rule with no
> > match, actions, etc. specified)
> >
> > * (rule)
> >
> >
> > Error in KERNEL::UNBOUND-SYMBOL-ERROR-HANDLER:  the variable #:NAME2396 is
> > unbound.
> >    [Condition of type UNBOUND-VARIABLE]
> >
> > Restarts:
> >   0: [ABORT] Return to Top-Level.
> >
> > Debug  (type H for help)
> >
> > (EVAL #:NAME2396)
> >
> > Jim
> >
> >
> > James E. Prewett                    [hidden email] [hidden email]
> > Systems Team Leader           LoGS: http://www.hpc.unm.edu/~download/LoGS/
> > Designated Security Officer         OpenPGP key: pub 1024D/31816D93
> > HPC Systems Engineer III   UNM HPC  505.277.8210
> >
> >
> > _______________________________________________
> > LoGS-devel mailing list
> > [hidden email]
> > http://lists.nongnu.org/mailman/listinfo/logs-devel
> >
>
>
> _______________________________________________
> LoGS-devel mailing list
> [hidden email]
> http://lists.nongnu.org/mailman/listinfo/logs-devel
>


_______________________________________________
LoGS-devel mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/logs-devel
Reply | Threaded
Open this post in threaded view
|

Re: bug in latest Language/rdl.lisp

Jim Prewett

Hi Vijay,

Ok, glad you think thats an OK fix :)

I'm a *big fan* of unit testing.  A friend sold me on "Unit Testing" a
couple of years or so ago, and it has, IMO, really really helped me to
develop LoGS.  I feel much more confident in changing things because I
know my tests will catch whatever I've screwed up.

I just wish that LoGS had more tests and had been built with lots of
testing from the beginning :)

Jim <getting off my soapbox now ;) >

James E. Prewett                    [hidden email] [hidden email]
Systems Team Leader           LoGS: http://www.hpc.unm.edu/~download/LoGS/ 
Designated Security Officer         OpenPGP key: pub 1024D/31816D93    
HPC Systems Engineer III   UNM HPC  505.277.8210

On Thu, 3 Aug 2006, Vijay Lakshminarayanan wrote:

> On 8/3/06, Jim Prewett <[hidden email]> wrote:
> >
> > I just committed a minor change to rdl.lisp; now, instead of letting the
> > RDL code come up with the name of an unnamed rule, I leave that to the
> > make-instance method in the :LoGS package for the RULE class.
> >
> > I can see where you, Vijay, were going with it, I just can't figure out
> > how to quote that name if it is a symbol rather than trying to evaluate
> > it.  I'm open to other suggestions :)
>
> LANGUAGE> (let ((name 'rule-name))
>            (rule named name))
> #<RULE name: RULE-NAME match: NIL delete-rule: NIL continuep: NIL
> actions: NIL environment: NIL  match-count: 0  match-try: 0 {AE40551}>
>
> LANGUAGE> (let ((name 'rule-name))
>            (rule named 'name))
> [warnings deleted]
> #<RULE name: NAME match: NIL delete-rule: NIL continuep: NIL actions:
> NIL environment: NIL  match-count: 0  match-try: 0 {AF54D81}>
>
> However, I prefer your current change.  It makes more sense to
> delegate the work to make-instance when we don't know the default
> since it reduces the number of places where we must update our changes
> (something RDL in general suffers from :-)
>
> The problem was, as you noted, I'd forgotten to quote the gensym which
> resulted in the enviomnent evaluating a freshly interned symbol
> #:NAME1245.  This is a lesson to me that I must once in a while try to
> evaluate also, rather than just macroexpand-1'ing :-)
>
> (defmethod get-rule-slot ((rule rule-macro) (slot (eql :name)))
>  (declare (ignore slot))
>  (or (rule-macro-name rule) `',(gensym "NAME")))
>
> would have fixed it but I think you made the right choice to remove it.
>
> > All tests pass again with this (minor) change.
> >
> > Jim
> >
> > James E. Prewett                    [hidden email] [hidden email]
> > Systems Team Leader           LoGS: http://www.hpc.unm.edu/~download/LoGS/
> > Designated Security Officer         OpenPGP key: pub 1024D/31816D93
> > HPC Systems Engineer III   UNM HPC  505.277.8210
> >
> > On Thu, 3 Aug 2006, Jim Prewett wrote:
> >
> > >
> > > Hi all,
> > >
> > > I've found a bug in the RDL code; I've not had a chance to find it yet.
> > >
> > > However, a rule that is created using the RDL without specifying a name
> > > throws an error as it tries to evaluate the symbol that is generated (that
> > > symbol should be used as the name).
> > >
> > > Under CMUCL 19 C, I get this for the simplest case (a new rule with no
> > > match, actions, etc. specified)
> > >
> > > * (rule)
> > >
> > >
> > > Error in KERNEL::UNBOUND-SYMBOL-ERROR-HANDLER:  the variable #:NAME2396 is
> > > unbound.
> > >    [Condition of type UNBOUND-VARIABLE]
> > >
> > > Restarts:
> > >   0: [ABORT] Return to Top-Level.
> > >
> > > Debug  (type H for help)
> > >
> > > (EVAL #:NAME2396)
> > >
> > > Jim
> > >
> > >
> > > James E. Prewett                    [hidden email] [hidden email]
> > > Systems Team Leader           LoGS: http://www.hpc.unm.edu/~download/LoGS/
> > > Designated Security Officer         OpenPGP key: pub 1024D/31816D93
> > > HPC Systems Engineer III   UNM HPC  505.277.8210
> > >
> > >
> > > _______________________________________________
> > > LoGS-devel mailing list
> > > [hidden email]
> > > http://lists.nongnu.org/mailman/listinfo/logs-devel
> > >
> >
> >
> > _______________________________________________
> > LoGS-devel mailing list
> > [hidden email]
> > http://lists.nongnu.org/mailman/listinfo/logs-devel
> >
>


_______________________________________________
LoGS-devel mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/logs-devel
Reply | Threaded
Open this post in threaded view
|

Re: bug in latest Language/rdl.lisp

Vijay Lakshminarayanan
On 8/3/06, Jim Prewett <[hidden email]> wrote:
>
> Hi Vijay,
>
> Ok, glad you think thats an OK fix :)
>
> I'm a *big fan* of unit testing.  A friend sold me on "Unit Testing" a
> couple of years or so ago, and it has, IMO, really really helped me to
> develop LoGS.  I feel much more confident in changing things because I
> know my tests will catch whatever I've screwed up.

And you have sold me into them too :-)  I think they're really useful
especially with CLUnit being as good as it is.  I have run tests.lisp
several times but always put off writing a formal test for RDL.

I just checked in rdl-tests.lisp with about 10 tests.  I'll add more soon.

Thanks Jim
Vijay

> I just wish that LoGS had more tests and had been built with lots of
> testing from the beginning :)
>
> Jim <getting off my soapbox now ;) >
>
> James E. Prewett                    [hidden email] [hidden email]
> Systems Team Leader           LoGS: http://www.hpc.unm.edu/~download/LoGS/
> Designated Security Officer         OpenPGP key: pub 1024D/31816D93
> HPC Systems Engineer III   UNM HPC  505.277.8210
>
> On Thu, 3 Aug 2006, Vijay Lakshminarayanan wrote:
>
> > On 8/3/06, Jim Prewett <[hidden email]> wrote:
> > >
> > > I just committed a minor change to rdl.lisp; now, instead of letting the
> > > RDL code come up with the name of an unnamed rule, I leave that to the
> > > make-instance method in the :LoGS package for the RULE class.
> > >
> > > I can see where you, Vijay, were going with it, I just can't figure out
> > > how to quote that name if it is a symbol rather than trying to evaluate
> > > it.  I'm open to other suggestions :)
> >
> > LANGUAGE> (let ((name 'rule-name))
> >            (rule named name))
> > #<RULE name: RULE-NAME match: NIL delete-rule: NIL continuep: NIL
> > actions: NIL environment: NIL  match-count: 0  match-try: 0 {AE40551}>
> >
> > LANGUAGE> (let ((name 'rule-name))
> >            (rule named 'name))
> > [warnings deleted]
> > #<RULE name: NAME match: NIL delete-rule: NIL continuep: NIL actions:
> > NIL environment: NIL  match-count: 0  match-try: 0 {AF54D81}>
> >
> > However, I prefer your current change.  It makes more sense to
> > delegate the work to make-instance when we don't know the default
> > since it reduces the number of places where we must update our changes
> > (something RDL in general suffers from :-)
> >
> > The problem was, as you noted, I'd forgotten to quote the gensym which
> > resulted in the enviomnent evaluating a freshly interned symbol
> > #:NAME1245.  This is a lesson to me that I must once in a while try to
> > evaluate also, rather than just macroexpand-1'ing :-)
> >
> > (defmethod get-rule-slot ((rule rule-macro) (slot (eql :name)))
> >  (declare (ignore slot))
> >  (or (rule-macro-name rule) `',(gensym "NAME")))
> >
> > would have fixed it but I think you made the right choice to remove it.
> >
> > > All tests pass again with this (minor) change.
> > >
> > > Jim
> > >
> > > James E. Prewett                    [hidden email] [hidden email]
> > > Systems Team Leader           LoGS: http://www.hpc.unm.edu/~download/LoGS/
> > > Designated Security Officer         OpenPGP key: pub 1024D/31816D93
> > > HPC Systems Engineer III   UNM HPC  505.277.8210
> > >
> > > On Thu, 3 Aug 2006, Jim Prewett wrote:
> > >
> > > >
> > > > Hi all,
> > > >
> > > > I've found a bug in the RDL code; I've not had a chance to find it yet.
> > > >
> > > > However, a rule that is created using the RDL without specifying a name
> > > > throws an error as it tries to evaluate the symbol that is generated (that
> > > > symbol should be used as the name).
> > > >
> > > > Under CMUCL 19 C, I get this for the simplest case (a new rule with no
> > > > match, actions, etc. specified)
> > > >
> > > > * (rule)
> > > >
> > > >
> > > > Error in KERNEL::UNBOUND-SYMBOL-ERROR-HANDLER:  the variable #:NAME2396 is
> > > > unbound.
> > > >    [Condition of type UNBOUND-VARIABLE]
> > > >
> > > > Restarts:
> > > >   0: [ABORT] Return to Top-Level.
> > > >
> > > > Debug  (type H for help)
> > > >
> > > > (EVAL #:NAME2396)
> > > >
> > > > Jim
> > > >
> > > >
> > > > James E. Prewett                    [hidden email] [hidden email]
> > > > Systems Team Leader           LoGS: http://www.hpc.unm.edu/~download/LoGS/
> > > > Designated Security Officer         OpenPGP key: pub 1024D/31816D93
> > > > HPC Systems Engineer III   UNM HPC  505.277.8210
> > > >
> > > >
> > > > _______________________________________________
> > > > LoGS-devel mailing list
> > > > [hidden email]
> > > > http://lists.nongnu.org/mailman/listinfo/logs-devel
> > > >
> > >
> > >
> > > _______________________________________________
> > > LoGS-devel mailing list
> > > [hidden email]
> > > http://lists.nongnu.org/mailman/listinfo/logs-devel
> > >
> >
>


_______________________________________________
LoGS-devel mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/logs-devel