1
我在寫一個.dot文件的列表列表來生成一棵樹。看起來,lisp中漂亮的打印機在輸出中插入了新行,所以當我執行點文件時,新行會使讀取生成的圖形變得困難。在一條線上的Lisp漂亮打印對象
我看過format
文檔,但我還沒有完全使用它。
下面是應打印樣本列表:
(((TOWER 'D 'C ^LEFT '0 ^RIGHT '2 ^BOTTOM '4 ^TOP '8)
(TOWER 'C 'B ^LEFT '0 ^RIGHT '2 ^BOTTOM '2 ^TOP '6)
(TOWER 'B 'A ^LEFT '0 ^RIGHT '2 ^BOTTOM '0 ^TOP '4) (ON 'D 'C)
(ON 'C 'B) (ON 'B 'A))
((TOWER 'D 'C ^LEFT '0 ^RIGHT '2 ^BOTTOM '4 ^TOP '8)
(TOWER 'C 'B ^LEFT '0 ^RIGHT '2 ^BOTTOM '2 ^TOP '6)
(TOWER 'B 'A ^LEFT '0 ^RIGHT '2 ^BOTTOM '0 ^TOP '4) (ON 'D 'C)
(ON 'C 'B) (ON 'B 'A))
((TOWER 'D 'C ^LEFT '0 ^RIGHT '2 ^BOTTOM '4 ^TOP '8)
(TOWER 'C 'B ^LEFT '0 ^RIGHT '2 ^BOTTOM '2 ^TOP '6)
(TOWER 'B 'A ^LEFT '0 ^RIGHT '2 ^BOTTOM '0 ^TOP '4) (ON 'D 'C)
(ON 'C 'B) (ON 'B 'A))
((TOWER 'D 'C ^LEFT '0 ^RIGHT '2 ^BOTTOM '4 ^TOP '8)
(TOWER 'C 'B ^LEFT '0 ^RIGHT '2 ^BOTTOM '2 ^TOP '6)
(TOWER 'B 'A ^LEFT '0 ^RIGHT '2 ^BOTTOM '0 ^TOP '4) (ON 'D 'C)
(ON 'C 'B) (ON 'B 'A))
((TOWER 'D 'C ^LEFT '0 ^RIGHT '2 ^BOTTOM '4 ^TOP '8)
(TOWER 'C 'B ^LEFT '0 ^RIGHT '2 ^BOTTOM '2 ^TOP '6)
(TOWER 'B 'A ^LEFT '0 ^RIGHT '2 ^BOTTOM '0 ^TOP '4) (ON 'D 'C)
(ON 'C 'B) (ON 'B 'A))
((TOWER 'D 'C ^LEFT '0 ^RIGHT '2 ^BOTTOM '4 ^TOP '8)
(TOWER 'C 'B ^LEFT '0 ^RIGHT '2 ^BOTTOM '2 ^TOP '6)
(TOWER 'B 'A ^LEFT '0 ^RIGHT '2 ^BOTTOM '0 ^TOP '4) (ON 'D 'C)
(ON 'C 'B) (ON 'B 'A)))
這裏是清單如何被打印到文件:
(((TOWER 'D 'C
^LEFT '0
^RIGHT '2
^BOTTOM '4
^TOP '8)
(TOWER 'C 'B
^LEFT '0
^RIGHT '2
^BOTTOM '2
^TOP '6)
(TOWER 'B 'A
^LEFT '0
^RIGHT '2
^BOTTOM '0
^TOP '4)
(ON 'D 'C)
(ON 'C 'B)
(ON 'B 'A))
((TOWER 'D 'C
^LEFT '0
^RIGHT '2
^BOTTOM '4
^TOP '8)
(TOWER 'C 'B
^LEFT '0
^RIGHT '2
^BOTTOM '2
^TOP '6)
(TOWER 'B 'A
^LEFT '0
^RIGHT '2
^BOTTOM '0
^TOP '4)
(ON 'D 'C)
(ON 'C 'B)
(ON 'B 'A))
((TOWER 'D 'C
^LEFT '0
^RIGHT '2
^BOTTOM '4
^TOP '8)
(TOWER 'C 'B
^LEFT '0
^RIGHT '2
^BOTTOM '2
^TOP '6)
(TOWER 'B 'A
^LEFT '0
^RIGHT '2
^BOTTOM '0
...
...
...
什麼format
指令應該使用以獲得正確的格式輸出?
這裏是我使用
(format stream "~A [shape=record, label=\"{~A|~A|~A}\"];~%" a b c d)
您可能想要發佈可重現的測試代碼... –
此版本是否有幫助? – myselfesteem