Skip to content
View in the app

A better way to browse. Learn more.

Learn more

format text - help needed

Featured Replies

dear all,

 

i have a basic lisp-question to FORMAT and i did not find a solution...

 

INPUT

 

(setf alist '((/player "12" 1.0 1.0 1.0)
              (/player "23" 1.0 1.0 1.0)
              (/player "12" 1.0 1.0 1.0)	
              (/player "23" 1.0 1.0 1.0)))

;; with FORMAT to
=> /player "12" 1.0 1.0 1.0, /player "23" 1.0 1.0 1.0, /player "12" 1.0 1.0 1.0, /player "23" 1.0 1.0 1.0

 

by FORMAT 
=> i will save it in a TXT-file on desktop (that works (with-open-file...)), but i have a format-problems with the commatas and the ()

 

thanx for such basic-lisp-help

andré

(format t "~{~{~S~^ ~}~^, ~}" alist)

/player "12" 1.0 1.0 1.0, /player "23" 1.0 1.0 1.0, /player "12" 1.0 1.0 1.0, /player "23" 1.0 1.0 1.0
nil

:: use format nil if you want the result as a string.

 

  • Author

dear ldbeth

 

thanks for the solution - that's great!

 

all the best

andré

Create an account or sign in to comment

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.