From: arafiedah
Subject: ERROR :odd number of subform to setf
Date: 
Message-ID: <a8464fae6702b9f48ed908cb4d719536@localhost.talkaboutprogramming.com>
the condition type is :PROGRAM ERROR
mssg error:-
retry the compilation of file
continue compiling file but generate no output file
continue opening project file for editing but without compiling or
loading
Unwind to the top-level event-handling loop

this is the coding

1)knowledge based
(defclass firstnode (spare 1 spare 2)
((spare1status :ACCESSOR firstnode-spare1status :INITFORM 1)
(spare2status :ACCESSOR firstnode-spare2status :INITFORM 1)))

(DEFCLASS spare1()
((wirespare1 :ACCESSOR spare1-wirespare1 :INITFORM 1)))

(DEFCLASS spare2()
((wirespare2 :ACCESSOR spare1-wirespare2 :INITFORM 1)))

(setf fact1 '((a 1 (spare1))
              (b 1 (spare2))))

(setf fact2 '((a 0 (yes))
               (b 1 (no))

2)Fuction file
(setf n1 0)
(setf n2 0)

(defun func-firstnodeproblem(x)
(setf firstnodeproblem (list x)
(cond ((intersection firstnodeproblem '(a b))
       (setf node1 (nth 2 (assoc x fact1)))
       (setf n1 (nth 1 (assoc x fact1))))
      (t)))

(defun func-wirespare1problem(x)
(setf wirespare1problem (list x)
(cond ((intersection wirespare1problem '(a b))
        (setf node2 (nth 2 (assoc x fact2)))
       (setf n2 (nth 1 (assoc x fact2))))
      (t)))

3)ide lisp coding
//formdiagnos
(defun formdiagnos-rb-spare1 -on-clik (dialog widget)
(declare (ignore-if-unused dialog widget))
(setf diagnos 'spare1)
(func-firstnodeproblem 'a)
t)
   
(defun formdiagnos-rb-spare2 -on-clik (dialog widget)
(declare (ignore-if-unused dialog widget))
(setf diagnos 'spare2)
(func-firstnodeproblem 'b)
t)   

(defun formdiagnos-rb-spare2 -on-clik (dialog widget)
(declare (ignore-if-unused dialog widget))
 (cond 
((eq diagnos 'spare1)
(make-formmspare1)
(user-close dialog))
((eq wire 'spare2)
(make-formspare2)
((user-close dialog)))

//formspare1
(defun formspare1-buttonyes -on-clik (dialog widget)
(declare (ignore-if-unused dialog widget))
(setf wire 'yes)
(func-wirespare1problem 'a)
t)

(defun formspare1-buttonno -on-clik (dialog widget)
(declare (ignore-if-unused dialog widget))
(setf wire 'no)
(func-wirespare1problem 'b)
t)   

(defun formspare1-buttonok -on-clik (dialog widget)
(declare (ignore-if-unused dialog widget))
 (cond 
((eq wire 'yes)
(make-formmccb1)
(user-close dialog))
((eq wire 'no)
(make-formfinal)
(problemspare1)
(show-result)
(show-solve)(user-close dialog)))

4)problem file //where error message coming!!

(defun problemspare1 ()
(cond
((or (an(eq n1 1)
         (eq n2 1)))
      (setf m-s 1 (setf m-s1 '(Maybe there is problem at   
       SPARE NO.1))))
      (t (setf m-s 0 (setf m-s1 '(There is nothing problem 
       at SPARE NO 1)))))

(defun show-solve()
(setf (property (find-widget ':solve ':formresult) 'value)
(format nil " System show ~s. So maybe have any of the components at there
need to be repair. The components there is fius and control suis" m-s1)))

(defun show-result()
(setf (property (find-widget ':result ':formresult) 'value)
(format nil "~s" m-s1)))


note: hope this can make all be clear what my problem and hope other not
make the mistake like mine.....

From: Vassil Nikolov
Subject: Re: ERROR :odd number of subform to setf
Date: 
Message-ID: <lzllf4z335.fsf@janus.vassil.nikolov.names>
"arafiedah" <·········@hotmail.com> writes:

> [...]
> (defun problemspare1 ()
> (cond
> ((or (an(eq n1 1)
>          (eq n2 1)))
>       (setf m-s 1 (setf m-s1 '(Maybe there is problem at SPARE NO.1))))
                  ^^^

  Should there have been a right parenthesis after the 1?  I.e.
  (SETF M-S 1) (SETF M-S1 ...) ...


>       (t (setf m-s 0 (setf m-s1 '(There is nothing problem at SPARE NO 1)))))
                     ^^^

  Should there have been a right parenthesis after the 0, similarly to
  the previous one?


  (Sorry I'm only addressing the immediate problem at hand...)

  ---Vassil.


-- 
Vassil Nikolov <········@poboxes.com>

Hollerith's Law of Docstrings: Everything can be summarized in 72 bytes.
From: Peter Seibel
Subject: Re: ERROR :odd number of subform to setf
Date: 
Message-ID: <m3u0tscmr9.fsf@javamonkey.com>
"arafiedah" <·········@hotmail.com> writes:

> this is the coding

> (defun func-firstnodeproblem(x)
> (setf firstnodeproblem (list x)
> (cond ((intersection firstnodeproblem '(a b))
>        (setf node1 (nth 2 (assoc x fact1)))
>        (setf n1 (nth 1 (assoc x fact1))))
>       (t)))

Looks like you're missing a close paren on the line that starts with
"setf" above. You're life will be much easier if you use an editor
that knows how to indent s-expressions; the problem would presumably
leaps out at you when your editor indented that function like:

  (defun func-firstnodeproblem(x)
    (setf firstnodeproblem (list x)
          (cond ((intersection firstnodeproblem '(a b))
                 (setf node1 (nth 2 (assoc x fact1)))
                 (setf n1 (nth 1 (assoc x fact1))))
                (t))))

Instead of what you want:

  (defun func-firstnodeproblem(x)
    (setf firstnodeproblem (list x))
    (cond ((intersection firstnodeproblem '(a b))
           (setf node1 (nth 2 (assoc x fact1)))
           (setf n1 (nth 1 (assoc x fact1))))
          (t)))

-Peter

-- 
Peter Seibel                                      ·····@javamonkey.com

         Lisp is the red pill. -- John Fraser, comp.lang.lisp
From: Harald Hanche-Olsen
Subject: Re: ERROR :odd number of subform to setf
Date: 
Message-ID: <pcohdps6j9t.fsf@shuttle.math.ntnu.no>
+ Peter Seibel <·····@javamonkey.com>:

| [Your] life will be much easier if you use an editor
| that knows how to indent s-expressions;

This point just cannot be emphasized enough.  Not only that, one needs
to use the feature.  All in all, I find that good editing habits
eliminate a lot of silly parantheses matching mistakes and let me
easily diagnose the ones that somehow slip through.

For instance, my life with Lisp became much improved once I learned
never to type any parentheses at all.  With emacs, I use
meta-left-parenthesis, which inserts a matched pair with the cursor in
between.  I do this even if I find that a sequence of forms should
have had another form wrapped around them: I first type in the
surrounding form, say, (let ((foo (bar)))), using the above technique,
then move beyond the end of the new form, set a mark, use M-C-f over
the forms that should have been inside my new form (note that this
guarantees that you inlcude complete subforms with no risk of
miscounting parentheses at the end), cut with C-w, move back inside
the new form, and yank it back with C-y.  Finally, up a few levels and
reindent (using M-C-q).

All this is much harder to describe (and read about) than to do.  Once
you're in the habit, paren matching bugs just cease to be an issue.

I wonder if books aimed at Lisp beginners shouldn't spend a chapter on
good Lisp editing techniques.

-- 
* Harald Hanche-Olsen     <URL:http://www.math.ntnu.no/~hanche/>
- Debating gives most of us much more psychological satisfaction
  than thinking does: but it deprives us of whatever chance there is
  of getting closer to the truth.  -- C.P. Snow
From: Matthew Danish
Subject: Re: ERROR :odd number of subform to setf
Date: 
Message-ID: <87isa77ezr.fsf@mapcar.org>
You might find it easier to supply the universal argument to M-(.  For
example, M-1 M-( will wrap the next form in parentheses.  M-2 M-( will
wrap the next 2 forms in parentheses, etc...

(foo)
^ point

hit M-1 M-( and the result is:

((foo))
 ^ point

-- 
;;;; Matthew Danish -- user: mrd domain: cmu.edu
;;;; OpenPGP public key: C24B6010 on keyring.debian.org
From: Harald Hanche-Olsen
Subject: Re: ERROR :odd number of subform to setf
Date: 
Message-ID: <pcowtym5nxs.fsf@shuttle.math.ntnu.no>
+ Matthew Danish <··········@cmu.edu>:

| You might find it easier to supply the universal argument to M-(.

Hmm, indeed.  Unless, of course, the number of forms I wish to wrap is
too great to count easily.  So what I would like even better, is this:
If transient mark mode is on and the mark is active, wrap the region.
Possibly with a sanity check to make sure that no form is partially
included by this.

-- 
* Harald Hanche-Olsen     <URL:http://www.math.ntnu.no/~hanche/>
- Debating gives most of us much more psychological satisfaction
  than thinking does: but it deprives us of whatever chance there is
  of getting closer to the truth.  -- C.P. Snow