Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6948725
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:51:38+00:00 2026-05-27T13:51:38+00:00

This code works as I want, except for the warning message. In GNU Common

  • 0

This code works as I want, except for the warning message. In GNU Common Lisp, how do I suppress that message without suppressing other possible warning messages?

 1 (defgeneric zang (x y)
 2   (:documentation "they want you to put documentation here"))
 3 (defmethod zang ((a number) (b string))
 4   (format t "got to zang ((~s number) (~s string))~%" a b))
 5 (defmethod zang ((a integer) (b string))
 6   (format t "got to zang ((~s integer) (~s string))~%" a b)
 7   (when (evenp a)
 8     (format t "passing control to the other guy~%")
 9     (call-next-method (1+ a) "hoo boy")
10     (format t "returned control from the other guy~%")))
11 (defmethod no-applicable-method (zang &rest args)
12   (format t "no applicable method for (zang ~{~s~^ ~})~%" args))
13 (zang 3.5 "hi")
14 (zang 3 "hi")
15 (zang 4 "hi")
16 (zang "hello" "world")
WARNING: Replacing method #<STANDARD-METHOD (#<BUILT-IN-CLASS T>)> in
         #<STANDARD-GENERIC-FUNCTION NO-APPLICABLE-METHOD>
got to zang ((3.5 number) ("hi" string))
got to zang ((3 integer) ("hi" string))
got to zang ((4 integer) ("hi" string))
passing control to the other guy
got to zang ((5 number) ("hoo boy" string))
returned control from the other guy
no applicable method for (zang "hello" "world")

EDIT in response to Vatine‘s kind reply:

I tried that, and the situation escalated from a warning to a fatal error:

 (defgeneric zang (x y)
   (:documentation "they want you to put documentation here"))
 (defmethod zang ((a number) (b string))
   (format t "got to zang ((~s number) (~s string))~%" a b))
 (defmethod zang ((a integer) (b string))
   (format t "got to zang ((~s integer) (~s string))~%" a b)
   (when (evenp a)
     (format t "passing control to the next guy~%")
     (call-next-method (1+ a) "hoo boy")
     (format t "returned control from the next guy~%")))
 ;(defmethod no-applicable-method (zang &rest args)
 ;  (format t "no applicable method for (zang ~{~s~^ ~})~%" args))
 (defmethod no-applicable-method ((zang eql #'zang) &rest args)
   (format t "no applicable method for (zang ~{~s~^ ~})~%" args))
 (zang 3.5 "hi")
 (zang 3 "hi")
 (zang 4 "hi")
 (zang "hello" "world")
*** - DEFMETHOD NO-APPLICABLE-METHOD: Invalid specialized parameter in method
      lambda list ((ZANG EQL #'ZANG) &REST ARGS): (ZANG EQL #'ZANG)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T13:51:39+00:00Added an answer on May 27, 2026 at 1:51 pm

    You need to provide a correct argument list for NO-APPLICABLE-METHOD.
    If you use a compiler (even the CLISP implementation can compile via COMPILE-FILE), you also should get an error message at compile time about the incorrect argument list.

    The LispWorks compiler for example says:

    **++++ Error between functions:
     An argument is not an atom or list of two elements : (ZANG EQL (FUNCTION ZANG))
    

    Fixed version:

    (defgeneric zang (x y)
       (:documentation "they want you to put documentation here"))
    (defmethod zang ((a number) (b string))
       (format t "got to zang ((~s number) (~s string))~%" a b))
    (defmethod zang ((a integer) (b string))
       (format t "got to zang ((~s integer) (~s string))~%" a b)
       (when (evenp a)
         (format t "passing control to the next guy~%")
         (call-next-method (1+ a) "hoo boy")
         (format t "returned control from the next guy~%")))
    ;(defmethod no-applicable-method (zang &rest args)
    ;  (format t "no applicable method for (zang ~{~s~^ ~})~%" args))
    
    (defmethod no-applicable-method ((zang (eql #'zang)) &rest args)
       (format t "no applicable method for (zang ~{~s~^ ~})~%" args))
    

    Example:

    (defun test ()
     (zang 3.5 "hi")
     (zang 3 "hi")
     (zang 4 "hi")
     (zang "hello" "world"))
    
    CL-USER 1 > (test)
    got to zang ((3.5 number) ("hi" string))
    got to zang ((3 integer) ("hi" string))
    got to zang ((4 integer) ("hi" string))
    passing control to the next guy
    got to zang ((5 number) ("hoo boy" string))
    returned control from the next guy
    no applicable method for (zang "hello" "world")
    NIL
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i want to put the id into the colorbox below this code nom works
I got this code from someone and it works very well, I just want
Why this code don't work,when i want run this code vwd 2008 express show
This code selects the nodes, I want to work on...: <xsl:variable name=rootTextpageNode select=$currentPage/ancestor-or-self::node [@level
i want to do this simple piece of code work. #include <iostream> #include <windows.h>
This code works (C# 3) double d; if(d == (double)(int)d) ...; Is there a
This code works fine: $result = $client->__call(optionalInfo, array( new SoapParam(..., client), new SoapParam(..., add_code))
This code works, but i dont understand why. With DeferredLoadingEnabld = false, I would
This code works in a windows forms application (it shows the preview) but not
This code works correctly to make a web service call: int numberOfGuests = Convert.ToInt32(search.Guest);

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.