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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:32:58+00:00 2026-05-27T16:32:58+00:00

i’m writing a chronometer in common lisp, output is being displayed in standard-output. what

  • 0

i’m writing a chronometer in common lisp, output is being displayed in standard-output. what i’m trying to do is replace the output without printing a newline and without printing side-by-side but by overwriting the previous output so there is an illusion of continuity.

is there anyway to do this in common lisp?

  • 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-27T16:32:58+00:00Added an answer on May 27, 2026 at 4:32 pm

    OK, after reading the comments, I understand your intentions much better. From you original question, I assumed you wanted to replace/augment the output of some other code. But now I understand, what you actually want is to update the screen. This cannot be done with stream-based IO alone, you need some other kind of IO library like ncurses.

    A Common Lisp binding for ncurses is the system cl-charms (available in QuickLisp). There is no cl-charms specific documentation, but the documentation for using ncurses in C can be applied almost unchanged. Here is a simple implementation for the task you’re describing, ie. it displays (for 10 seconds) a clock in the left upper corner of the screen:

    (defun clock ()
      (charms:initscr)
      (charms:clear)
      (charms:curs-set 0)
      (loop with start = (get-universal-time)
            do (multiple-value-bind (s m h) (get-decoded-time)
                 (charms:mvaddstr 0 0 (format nil "~2,'0d:~2,'0d:~2,'0d" h m s)))
               (charms:refresh)
            until (>= (- (get-universal-time) start) 10))
      (charms:endwin))
    

    Two problems I’ve experienced with this:

    • This worked only in a terminal, not in the Emacs slime-repl buffer.

    • cl-charms couldn’t find my installation of the curses library by itself. It was looking for a library named “libcurses.so” or “libncurses.so”, but on my system, the library was only present with versioned names. So I had to use the USE-VALUE restart during loading the library and provide the alternative value ("libncurses.so.5") for the list of library names. For using the library often, you should probably want to change the library source code and maybe suggest a patch to the developers.

    The cl-charms homepage linked from CLiki is not available, but the repository at http://gitorious.org/cl-charms is.

    Here’s a short explanation of the ncurses/cl-charms functions I used in the example:

    • initscr initializes ncurses.
    • clear clears the screen.
    • curs-set sets cursor visibility, 0 means invisible.
    • mvaddstr moves the cursor to the coordinates y, x and writes a string there, replacing what was there on the screen previously.
    • refresh makes the changes to the screen actually visible.
    • endwin is the clean-up function to call when you’re finished with ncurses.


    If I understand correctly what you’re trying to do, the best approach seems to be to create a new output stream class (i.e. a subclass of fundamental-character-output-stream, assuming your implementation supports Gray Streams). You should probably provide methods specialised for your class at least for stream-write-charand stream-write-string.

    Then you could wrap code with a redefinition of *standard-output* to an instance of your class, somewhat like this:

    (let ((*standard-output* (make-instance 'your-stream-class
                                            :target *standard-output*)))
      (function-to-be-called-with-wrapped-standard-output))
    

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

Sidebar

Related Questions

I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm trying to select an H1 element which is the second-child in its group
Does anyone know how can I replace this 2 symbol below from the string

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.