Jump to content

Featured Replies

Posted

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


Copyright © 2014-2025 Opusmodus™ Ltd. All rights reserved.
Product features, specifications, system requirements and availability are subject to change without notice.
Opusmodus, the Opusmodus logo, and other Opusmodus trademarks are either registered trademarks or trademarks of Opusmodus Ltd.
All other trademarks contained herein are the property of their respective owners.

Powered by Invision Community

Important Information

Terms of Use Privacy Policy