Welcome to the CHICKEN Scheme pasting service

Wrapping getstr from Scheme pasted by wasamasa on Wed Jan 3 21:52:36 2018

(use ncurses srfi-4 lolevel srfi-1)

(define (get-string max)
  (let ((buffer (make-u8vector max)))
    (getstr (make-locative buffer))
    (let ((bytes (take-while (lambda (byte) (not (zero? byte)))
                             (u8vector->list buffer))))
      (list->string (map integer->char bytes)))))

(let ((stdscr (initscr))
      (str (get-string 10)))
  (addstr str)
  (getch))

Simpler version with Scheme strings added by wasamasa on Wed Jan 3 22:13:37 2018

(use ncurses lolevel data-structures)

(define (get-string max)
  (let ((buffer (make-string max #\null)))
    (getnstr (make-locative buffer) max)
    (string-translate buffer #\null)))

(let ((stdscr (initscr))
      (str (get-string 10)))
  (addstr str)
  (getch)
  (write str))

Your annotation:

Enter a new annotation:

Your nick:
The title of your paste:
Your paste (mandatory) :
Which procedure can be used to check whether its argument is a procedure?
Visually impaired? Let me spell it for you (wav file) download WAV