[CM] s7: How to use pretty-print in write.scm
Kjetil Matheussen
k.s.matheussen at gmail.com
Tue Dec 13 08:17:58 PST 2016
Hi,
'pretty-print' in write.scm seems to behave the same way as 'display',
and I can't find any documentation about the function.
For instance, is there a way to make
(pretty-print '(((hash-table '(:place . 53) '(:duration . 3473301/65534)
'(:pitches (hash-table '(:place . 0) '(:value . 0.0) '(:logtype . 0)
'(:chance . 1.0)) (hash-table '(:place . 347
3301/65534) '(:value . 53.0) '(:logtype . 0) '(:chance . 1.0)))
'(:velocities (hash-table '(:place . 0) '(:value . 0.79998779296875)
'(:logtype . 0)) (hash-table '(:place . 3473301/65534) '(:value .
0.7999877929
6875) '(:logtype . 0))) '(:continues-next-block . #t)))))
print out
"
(((hash-table '(:place . 53)
'(:duration . 3473301/65534)
'(:pitches (hash-table '(:place . 0)
'(:value . 0.0)
'(:logtype . 0)
'(:chance . 1.0))
(hash-table '(:place . 3473301/65534)
'(:value . 53.0)
'(:logtype . 0)
'(:chance . 1.0)))
'(:velocities (hash-table '(:place . 0)
'(:value . 0.79998779296875)
'(:logtype . 0))
(hash-table '(:place . 3473301/65534)
'(:value . 0.79998779296875)
'(:logtype . 0)))
'(:continues-next-block . #t))))
"
?
Guile prints out this:
"
(((hash-table
'(:place . 53)
'(:duration . 3473301/65534)
'(:pitches
(hash-table
'(:place . 0)
'(:value . 0.0)
'(:logtype . 0)
'(:chance . 1.0))
(hash-table
'(:place . 3473301/65534)
'(:value . 53.0)
'(:logtype . 0)
'(:chance . 1.0)))
'(:velocities
(hash-table
'(:place . 0)
'(:value . 0.79998779296875)
'(:logtype . 0))
(hash-table
'(:place . 3473301/65534)
'(:value . 0.79998779296875)
'(:logtype . 0)))
'(:continues-next-block . #t))))
"
which is good enough, perhaps even better, but s7 prints out this:
"
(((hash-table '(:place . 53) '(:duration . 3473301/65534) '(:pitches
(hash-table '(:place . 0) '(:value . 0.0) '(:logtype . 0) '(:chance . 1.0))
(hash-table '(:place . 3473301/65534) '(:value . 53.0) '(:logtype
. 0) '(:chance . 1.0))) '(:velocities (hash-table '(:place . 0) '(:value .
0.79998779296875) '(:logtype . 0)) (hash-table '(:place . 3473301/65534)
'(:value . 0.79998779296875) '(:logtype . 0))) '(:continues-nex
t-block . #t))))
"
which is just one lon gline.
I've tried to set the "column" argument for pretty-print, but it doesn't
seem to make a difference.
Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cm-mail.stanford.edu/mailman/private/cmdist/attachments/20161213/cb95f38a/attachment.html>
More information about the Cmdist
mailing list