top | item 44683729 (no title) dimitar | 7 months ago Can you give an example? I can't speak for all possible lisps but Common Lisp and clojure have great string built-ins:https://lispcookbook.github.io/cl-cookbook/strings.htmlhttps://clojuredocs.org/clojure.string discuss order hn newest z_open|7 months ago printf("x = %6d\ny = %.8E\n", x, y) ;What's the equivalent lisp? mrcode007|7 months ago (format t "x = ~6d~%y = ~.8E~%" x y) taeric|7 months ago The "format string" capabilities of common lisp are quite advanced. https://gigamonkeys.com/book/a-few-format-recipes is a fun overview. load replies (1) rscho|7 months ago You seriously thought that lisps had no printf equivalent ?! load replies (1) zck|7 months ago Someone else has given you the Common Lisp version. Here's one for Clojure: (printf "x = %6d\ny = %.8E\n" x y) If I've understood everything right, and your example is in C, the format string in Clojure is identical to the one in your comment.
z_open|7 months ago printf("x = %6d\ny = %.8E\n", x, y) ;What's the equivalent lisp? mrcode007|7 months ago (format t "x = ~6d~%y = ~.8E~%" x y) taeric|7 months ago The "format string" capabilities of common lisp are quite advanced. https://gigamonkeys.com/book/a-few-format-recipes is a fun overview. load replies (1) rscho|7 months ago You seriously thought that lisps had no printf equivalent ?! load replies (1) zck|7 months ago Someone else has given you the Common Lisp version. Here's one for Clojure: (printf "x = %6d\ny = %.8E\n" x y) If I've understood everything right, and your example is in C, the format string in Clojure is identical to the one in your comment.
taeric|7 months ago The "format string" capabilities of common lisp are quite advanced. https://gigamonkeys.com/book/a-few-format-recipes is a fun overview. load replies (1)
zck|7 months ago Someone else has given you the Common Lisp version. Here's one for Clojure: (printf "x = %6d\ny = %.8E\n" x y) If I've understood everything right, and your example is in C, the format string in Clojure is identical to the one in your comment.
z_open|7 months ago
What's the equivalent lisp?
mrcode007|7 months ago
taeric|7 months ago
rscho|7 months ago
zck|7 months ago