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 293815
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T06:18:36+00:00 2026-05-12T06:18:36+00:00

I have decided to learn (Common) Lisp a few days ago and I realize

  • 0

I have decided to learn (Common) Lisp a few days ago and I realize that this is quite a newbie question and it is probably extremely trivial to someone with at least a bit of experience.

So basically what happens is that I load up Emacs + Slime (via Lisp in a Box) and write my program (included below):

(defun last-char (s) "Get last character"
       (char s (- (length s) 1)))

And then I try to compile it with C - c M - k, but then I get the following warning:

CHAR is neither declared nor bound,
it will be treated as if it were declared SPECIAL.

What is the meaning of this warning? I suppose it might be something similar to forgetting #includes in C, but I can’t quite figure it out. What should I do about it? Shall I just simply ignore it?

  • 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-12T06:18:36+00:00Added an answer on May 12, 2026 at 6:18 am

    The warning means that char is not being recognized as a function, as it should, for some reason (it’s reporting that the symbol is unbound, it has no value).

    It might have something to do with your implementation. I’ve run your code using C-c M-k in my SBCL + Emacs/Slime (and in Clozure) and I get the following report from the compilation in SBCL:

    ; in: DEFUN LAST-CHAR
    ;     (CHAR S (- (LENGTH S) 1))
    ; --> AREF 
    ; ==>
    ;   (SB-KERNEL:HAIRY-DATA-VECTOR-REF ARRAY SB-INT:INDEX)
    ; 
    ; note: unable to
    ;   optimize
    ; due to type uncertainty:
    ;   The first argument is a STRING, not a SIMPLE-STRING.
    ; 
    ; note: unable to
    ;   avoid runtime dispatch on array element type
    ; due to type uncertainty:
    ;   The first argument is a STRING, not a SIMPLE-ARRAY.
    

    Try just typing

    #'char 
    

    on the REPL, the response should be that it is reported to be a function,

    CL-USER> #'char
    #<FUNCTION CHAR>
    

    but maybe it doesn’t in your implementation (I’m guessing it doesn’t, given the compiler warning and the fact that the code compiles correctly in SBCL). If that’s the case, then that is a point where your implementation departs from the ANSI Common Lisp specification, because that function should be there.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am an intermediate programmer, and have decided to learn either common lisp or
I've recently decided that I just have to finally learn C/C++, and there is
I decided to learn LISP today, and have been playing around with it for
this might be quite a newbie question, but i need to process a certain
I decided to learn C++ (I program in C at work), and I have
I have decided that all my WPF pages need to register a routed event.
I have decided that I really need to get some flowcharts for reverse engineering
I have some commits that I've decided, after the fact, are going to be
I have a largish Mercurial repository that I've decided would be better as several
I decided to teach myself assembly language. I have realized that my program will

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.