(save) files line breaks?

Q&A's, tips, howto's

(save) files line breaks?

Postby kanen » Mon Nov 17, 2014 6:21 pm

Whenever I save a file, the line breaks are set to some strange 80 columns or similar.

I'd like lines to break more reasonably and based on (set) statements instead. Otherwise, these files have strange line-breaks and I cannot read them outside newLisp

Example:

Code: Select all
(setf foo (rand 1000 100000))
(save "foo.lsp" 'foo)


Resulting in...

Code: Select all
(set 'foo '(477 628 364 513 952 916 635 717 141 606 16 242 137 804 156 400 129 108
  998 218 512 839 612 296 637 524 493 972 292 771 526 769 400 891 283 352 807 919
  69 949 525 86 192 663 890 348 64 20 457 63 238 970 902 850 266 539 375 760 512
...


Why doesn't this result in:

Code: Select all
(set 'foo '(477 628 364 513 952 916 635 717 141 606 16 242 137 804 156 400 129 108 998 218 512 839 612 296 637 524 493 972 292 771 526 769 400 891 283 352 807 919 69 949 525 86 192 663 890 348 64 20 457 63 238 970 902 850 266 539 375 760 512 ...


Is there a way to set the length of lines in a (save) file?
. Kanen Flowers http://kanen.me .
kanen
 
Posts: 145
Joined: Thu Mar 25, 2010 6:24 pm

Re: (save) files line breaks?

Postby HPW » Mon Nov 17, 2014 8:54 pm

Hello,

You may have a look at command 'pretty-print'.

Regards
Hans-Peter
HPW
 
Posts: 1374
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany

Re: (save) files line breaks?

Postby kanen » Tue Nov 18, 2014 2:25 am

(pretty-print 8192 " ") fixes it!

Thanks!

HPW wrote:Hello,

You may have a look at command 'pretty-print'.

Regards
. Kanen Flowers http://kanen.me .
kanen
 
Posts: 145
Joined: Thu Mar 25, 2010 6:24 pm


Return to newLISP in the real world

Who is online

Users browsing this forum: No registered users and 1 guest

cron