LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-09-2013, 10:19 PM   #1
hydraMax
Member
 
Registered: Jul 2010
Location: Skynet
Distribution: Debian + Emacs
Posts: 467
Blog Entries: 60

Rep: Reputation: 51
Common Lisp: Variable Defined but Not Used


I've got some common lisp code (SBCL) where I have to provide a lambda that takes a single argument, but in this case the argument is not actually used. So I get the Style Warning about defining but not using the variable. Is there a trick to suppress the warning for that variable without disabling that warning type completely?

E.g., in Haskell you can replace the variable name with an underscore, which tells the compiler you don't care what value is there.
 
Old 11-09-2013, 10:57 PM   #2
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,780

Rep: Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081
You can declare it as ignored, or ignorable.

Code:
(lambda (x) (declare (ignore x)) ...)
 
1 members found this post helpful.
Old 11-10-2013, 02:13 AM   #3
hydraMax
Member
 
Registered: Jul 2010
Location: Skynet
Distribution: Debian + Emacs
Posts: 467

Original Poster
Blog Entries: 60

Rep: Reputation: 51
Quote:
Originally Posted by ntubski View Post
You can declare it as ignored, or ignorable.

Code:
(lambda (x) (declare (ignore x)) ...)
Thanks!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Common lisp question. Alejandro_Zamora Programming 1 11-10-2013 05:34 PM
Common Lisp: CLOS and with-slots hydraMax Programming 1 06-10-2013 08:59 PM
Common Lisp functions. zaxonus Programming 2 07-09-2010 04:30 PM
can I make C + common lisp simpler than C alone? ta0kira Programming 7 03-08-2009 10:56 PM
Programming Ideas in Common Lisp Trizon Programming 1 03-03-2008 02:07 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:35 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration