cells-cvs
Threads by month
- ----- 2025 -----
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
March 2006
- 1 participants
- 28 discussions
Update of /project/cells/cvsroot/cells/doc
In directory clnet:/tmp/cvs-serv26430/doc
Modified Files:
motor-control.lisp
Added Files:
cells-overview.pdf
Log Message:
More work on Cells and Celtk
--- /project/cells/cvsroot/cells/doc/motor-control.lisp 2006/03/16 05:24:41 1.1
+++ /project/cells/cvsroot/cells/doc/motor-control.lisp 2006/03/22 04:08:35 1.2
@@ -50,6 +50,8 @@
definition and several method definitions):
|#
+(in-package :cells)
+
(defmodel motor ()
((status :initarg :status :accessor status :initform nil)
(fuel-pump :initarg :fuel-pump :accessor fuel-pump
--- /project/cells/cvsroot/cells/doc/cells-overview.pdf 2006/03/22 04:08:35 NONE
+++ /project/cells/cvsroot/cells/doc/cells-overview.pdf 2006/03/22 04:08:35 1.1
%PDF-1.2
%âãÏÓ
1 0 obj
<<
/CreationDate (D:191020131000911)
/Producer (\376\377\000A\000c\000r\000o\000b\000a\000t\000 \000D\000i\000s\000t\000i\000l\000l\000e\000r\000 \0003\000.\0000\0001\000 \000f\000o\000r\000 \000W\000i\000n\000d\000o\000w\000s)
/Title (Untitled Document)
/Creator (FrameMaker 5.5.6p145)
>>
endobj
3 0 obj
<<
/D [2 0 R /XYZ null null null]
>>
endobj
4 0 obj
<<
/D [2 0 R /XYZ null null null]
>>
endobj
5 0 obj
<<
/I <<
/Title (A)
>>
/F 6 0 R
>>
endobj
47 0 obj
<<
/D [2 0 R /XYZ 71 47 null]
>>
endobj
48 0 obj
<<
/D [2 0 R /XYZ 71 725 null]
>>
endobj
49 0 obj
<<
/D [2 0 R /XYZ 71 692 null]
>>
endobj
50 0 obj
<<
/D [2 0 R /XYZ 71 665 null]
>>
endobj
51 0 obj
<<
/D [2 0 R /XYZ 71 639 null]
>>
endobj
52 0 obj
<<
/Length 259
/Filter /FlateDecode
>>
stream
HdMkÃ0ïüíC<Ûù°{íŸ`;l0ßJ]êŠÔMÒ?9NYalIè}ô
¯M<Œ`i"$p<øjÅt yÉd æ&ì|ýÐô!3õ|_ÓdC>w¥YEâ
º5o+oX±d!ÈAqÅV*rçùLËBšä#-¥é:ªIíözñß¹ÌqJ#N,ÖïÍnöŸOÖ
0º="3E ö®Îc=ŽÞm#:êlF§èHÿ3Íà¡9 96Å~t/;AXFüí%éߌ[ç&0Ž€íï¢þ?âWw'Y»
endstream
endobj
53 0 obj
<<
/ProcSet [/PDF /Text ]
/Font <<
/F1 54 0 R
/F2 55 0 R
>>
/ExtGState <<
/GS1 56 0 R
>>
>>
endobj
59 0 obj
<<
/D [58 0 R /XYZ null null null]
>>
endobj
61 0 obj
<<
/D [58 0 R /XYZ 71 759 null]
>>
endobj
62 0 obj
<<
/D [58 0 R /XYZ 71 47 null]
>>
endobj
63 0 obj
<<
/D [58 0 R /XYZ 71 689 null]
>>
endobj
64 0 obj
<<
/D [58 0 R /XYZ 71 663 null]
>>
endobj
65 0 obj
<<
/D [58 0 R /XYZ 71 642 null]
>>
endobj
66 0 obj
<<
/D [58 0 R /XYZ 71 606 null]
>>
endobj
67 0 obj
<<
/D [58 0 R /XYZ 71 596 null]
>>
endobj
68 0 obj
<<
/D [58 0 R /XYZ 71 584 null]
>>
endobj
69 0 obj
<<
/D [58 0 R /XYZ 71 573 null]
>>
endobj
70 0 obj
<<
/D [58 0 R /XYZ 71 563 null]
>>
endobj
71 0 obj
<<
/D [58 0 R /XYZ 71 551 null]
>>
endobj
72 0 obj
<<
/D [58 0 R /XYZ 71 540 null]
>>
endobj
73 0 obj
<<
/D [58 0 R /XYZ 71 530 null]
>>
endobj
74 0 obj
<<
/D [58 0 R /XYZ 71 518 null]
>>
endobj
75 0 obj
<<
/D [58 0 R /XYZ 71 501 null]
>>
endobj
76 0 obj
<<
/D [58 0 R /XYZ 71 467 null]
>>
endobj
77 0 obj
<<
/D [58 0 R /XYZ 71 431 null]
>>
endobj
78 0 obj
<<
/D [58 0 R /XYZ 71 368 null]
>>
endobj
79 0 obj
<<
/D [58 0 R /XYZ 71 320 null]
>>
endobj
80 0 obj
<<
/D [58 0 R /XYZ 71 257 null]
>>
endobj
81 0 obj
<<
/D [58 0 R /XYZ 71 221 null]
>>
endobj
82 0 obj
<<
/D [58 0 R /XYZ 71 201 null]
>>
endobj
83 0 obj
<<
/D [58 0 R /XYZ 71 152 null]
>>
endobj
84 0 obj
<<
/D [58 0 R /XYZ 71 131 null]
>>
endobj
85 0 obj
<<
/Length 2572
/Filter /FlateDecode
>>
stream
HÄWÛãž}o ÿ@^€ ÅèjY f² 6X`yhçh[iYôŽçëSU€dÉîl^âŠuc±êTSÅ/ç§ßý9f[¬¢
ðþä1§9/¶Ø=?
l_þå[Ä6îxÂóòù)ËVÞŒ¯~æI?ŒÆè?O³Ò/ŒÎœcW'ÿ¿âŠÛ4dAVð€`?YsaDÝþ?Èœd1Sk¥œÁ÷3ë>]ÙfyÂãÂEVߌÌÃÐû¥kQÊÞNrAÎÉD
Îcï"6¢ðþÜÛúAâIŠw~0óD7l_ÃÒ2Ïø©w0§+bg,xÖÝÐmñ÷l@ì«{?Á~ÞÏß|ž[mDqà;ÝʰZ³J®°Žô²b_ú¡ÇVökÁì²Wœ0³,ÀòÜ#œÒlï°šÄÛ-®Æ¯k?œwk·0x¯)Ä0¢ÙG mÅNjÊè»|GôŸx'*œte LVâôpCà3Oµº®dçst_ïDÓ°ÕŸ¥5\Ñ¢-!+U%ûÞtÙíÍk~æÀ/(éÔU9ÏQáó°ôvÂ/ègË8ʪKûŒUF@ÄQoÃ~ÄØ«]ìD+6>üœV;Éh=Ût
öCÿ0¶Ïò{6º|DijÕ²ßàCð-^zØ*ÁÍ@
ô¥<ÊÖ,}kxñÛ+sW¿þ!Z1kkL-ÜîÓX»üÀÂ`|ž^úœÄÿñ;APü1¿RPFVßîôtéÉï
-ÿ?ý_þZªFuÁ»<[·ééÒ«1 O öºé$èÉk'«³[L2€D:/zJŒyš<š$P®»ZëºÝ'¡W Q7ïÉèQß*üâ°Ù2£ B+[uBÂk ÊØ4AÕÕÇ^êö{nHaPj ŽOHu²×uÍÙOÒ`¹ûYrWÞŒhÞAå:E^l%ÛwÊî5[Ùi[[ð
ð1»ëÆF7ÄE[ñ{º@ùh[§ãí&nh~EhãÆimÎ$< Gñ<Ðô<ÂXAG/¬&¹Z«²èBå-#EQ+tÚ2ÆŠ¯&Ч5°pŒ-YCÝG¶ °SÞ6è!âŧÐQV×*À;(ë>·àâ>D;
]F1cÂæMšG4¿îÀú ¯,ìö98œ®PûRcsŒ±?b«Ð{Ñ¿ºt
[aÖBCÔØØÕ »nMù7CÇÙllcA@WßtÍA©WiÛ#oØÏ¿M
Sné{ÜÓn¡_êXOÖÜ5ETB;6°Œy0°P¬uºŠwÂÃ<žM_{0ôÖu§
ŠògtcZ`áâ+£oÜ6i¯"!/ÐUÓHÙx€J¿N[£¶Þ€4ÉyO8ÖGdÕ&$NÑDU¹³U-6€Vd=3WÓJê`p\A [npª
vûÒøöUÙkôW7vYš8û[Û ÐLA!:$gÂ¥·áè^Ý¢[š]gòîNÃÆüÅ=*RÄ}ld2á"3!ù9éaPÈíæêYIh3É^vXÏE¶®#ÈVsîô Hy~® ð=nlDFËe&[šÉ¥Þ¡ñù ì<*Ús¯àE)GëœåwÅÖÀFx[w±Š·Ãã;¬ÓVã¡j÷Ó€fÔ%i|K&×ö1ÞOg¥<.¿Î~4 ºTGÙé8S²°^/OÙ'xƹë0îçìa5ÒLdYØ1Â,äóâãhðpãù0-vXª4ŠšWGÙgçb¢ïÃÍ>·âSõës&ÄÛËò`\)Lž24]
=2µHÅÇŠêí(À}zÞù{fG°C±"iŠ>Í)€|9
çŽ=//x:Y==
Ù3¶œ9yvPSŸtlÔc|8
ªÝÐ^Õ¶qÏúTG1Æ5s':(ÍŠóØùŸB
~öóÐãøÑÍI}"T o\$ËóGHÏòE({hÑ$ÁØûVÒd?6uiUõL4to C4ãyq5žôÐe?šC×öUÈ:ÂNV©öÁ¶ŠjU×_YzI2çQB5t«Ãèaí%EγÉòiíi;âÂŒh`ê²g~aסÏ.òñy>qÓÖ@X<ÑåÝÃ7?³h'¡¥BÊ$fÅîM-ܱgÜö€cÚß1äxJ,\ _$6©ù¥ãªÌb>ÝÒ)H×q#Íuúûô%<Í'g<µŒÐ8`1*O,ëöšÞq`vÞtui@þM³å;£ò:Ž ©Mûz]AåŸú¡14:ÊîM2ñFÕÓ§Óõ#Ÿ.=œ$èGĹ+c1Oâš<ÆÎ82c,nßÐÌ(Zy
Yx&USdüŸ£Yóytš·ôòÂÍÑü/®æ*lá/ûÕ%d¥
m[5XÂÞ}§6T-b7htµ«ÍK£9l±µ>û³dÿ6Z{ëµ'Or"&+E®ÙØ{õ¿©=Ò`aÉöóÏ kùì¶Ý!LQÎr¿¥'¿74-rªÙç¥YpÝÊSæ²ñNÒÀNêÐTlèoH8Ò-üT·:1Û&JlaiRÐ<OX resubîàH+dVÙËX¯ñZÑ'-íb%Jvî¶^ÛÜ^0g?ª5ÓFu.ÄáÆñAaä-|7ôUœa{Ëã-
Ñn;䮌ÆöÆäWæ CÌ Íö{Õ(ÊVO#,Š>Bñº»ª7(öIÛÌÖªÕ®/]X« ì!.h åÐnï÷
b\Km8I-iBT-vF?)áH.Š _[q¬ y
au³uÏ/
±-ÏЬCÛK gÄ/3œµù#âQwxõæí ðR4Íΰñ äú|)ºË©t޵ã`kh]ã§VÈ;éÎeãž]áü°x~úÏ.`}·
endstream
endobj
86 0 obj
<<
/ProcSet [/PDF /Text ]
/Font <<
/F1 54 0 R
/F2 55 0 R
/F3 87 0 R
/F4 88 0 R
/F5 89 0 R
/F6 90 0 R
/F7 91 0 R
>>
/ExtGState <<
/GS1 56 0 R
>>
>>
endobj
93 0 obj
<<
/D [92 0 R /XYZ null null null]
>>
endobj
60 0 obj
<<
/P 58 0 R
/R [63 63 549 693]
/V 6 0 R
/N 94 0 R
>>
endobj
95 0 obj
<<
/D [92 0 R /XYZ 71 759 null]
>>
endobj
96 0 obj
<<
/D [92 0 R /XYZ 71 47 null]
>>
endobj
97 0 obj
<<
/D [92 0 R /XYZ 71 687 null]
>>
endobj
98 0 obj
<<
/D [92 0 R /XYZ 71 666 null]
>>
endobj
99 0 obj
<<
/D [92 0 R /XYZ 71 632 null]
>>
endobj
100 0 obj
<<
/D [92 0 R /XYZ 71 596 null]
>>
endobj
101 0 obj
<<
/D [92 0 R /XYZ 71 561 null]
>>
endobj
102 0 obj
<<
/D [92 0 R /XYZ 71 470 null]
>>
endobj
103 0 obj
<<
/D [92 0 R /XYZ 71 393 null]
>>
endobj
104 0 obj
<<
/D [92 0 R /XYZ 71 372 null]
>>
endobj
105 0 obj
<<
/D [92 0 R /XYZ 71 296 null]
>>
endobj
106 0 obj
<<
/D [92 0 R /XYZ 71 162 null]
>>
endobj
107 0 obj
<<
/Length 2642
/Filter /FlateDecode
>>
stream
HW]ÛÈ|7àÿ0d°Rô±Zy}OïÎpÄd÷àäKÄñ2¬ªî¡€µµŒ£á|ôtWWWÿíáõ«¿þº0só°yýjŸ03üÃÛÕítœ6ëÛõô~iׯff¥þ57Û_ÓÙóåëWçØ~xýêsö>_e6Ì3Ïå¿,O{ßg]ŸÈö£Cþ¿óÖyºu1ÝÉê~ºŒ7?ó&;KGþVlqâ]fŠÝùížû.í,`â³ZÛ?gÿ^,Væïò7YãBÑÛhúÚÇø|²ÈyØã°5.CíÊÚìºvÛ\Òp0µÅëqáøÛzÛåuòYVxÌç3ÎÊmà{ú©Qgf2®WŸ3e+gŽ8ÃãµMŠæÑ»áÏèßëÝåcêvöÉÚ[<€«làÆ6šãýÓõ&Ìï <$ö8ÏTv'O8Cì×ÇlÅbW×ìh£y²@L¢ëp4â·ìŒ+·°Ú0Õë'ãýÏ]ðâ ïià6bB€ù>qõK! Á0Vl.&
2âÜ@K\/¿ µ¶îÄÆÞÁ0ó®ìB1K¿sÓZÌ$žgsÅ£Ýz×äkÚ³Ÿ°p(TçòeFµo
ûlõ7$îÓáâßHð?<ݶ3BK]übNYteÁû°Q+e±G9SÇ£áæF³ÅNî;×ìiZ}
?ýO#öÝãÓ7m§¶\÷ßóT.íèmA:HÇ·9ŸŠ¢Öàשa
¹¶ec^}ïÊsÀ&§£ï-<ë}{g®fþ¢üé,q/ã/¢LY©ô¶ÊtáÁõ5yÎtç±ñFŠC«Ç}¢ÀD²íxOþxbªòWûø
bG¶Á Å?ɲÎqr5g§'/ÓGo§
_suš$ޱßËÁ»êÚÞÛÆñïÀÁG%µml4Å9<uàBspÕÖö €ÖDå2¿ÍÜæš÷2d5Û3ÔÊ5ìºäÆ3bÄ|úV]³ëei@ÒE4ocïʧãÄ+x2J£æ-Æ'Êü6^\ñuæ[ëîÈb·åá5øù|y«VPŸ2c;(<*$[þ"ÖuÄ9²
O:»hÛv二{²t²Í)g"9 \ä«%®ÚZx¿ïùÍx
cŒä(Ù×5mgoÈn»û3¢*:IZ¡¢-Á4ó¥ÌéâÌÌ=¹ 2·wHï!L;ùYâúŸn£Õ'
l[¹Á ·4 >=ÖT]q0mžaZõèúîÄ9'ZÖç"6Ø'¥éº|Î*Ú?»=Cš`CÅøuPÇÅKâÇÔ3ûÍõHþÙj-Âìý¹hÈÞ=aÿù,G*úöUžë¬Œ±¢Ócmm`ÖB¥aÊ}]0 µz³œ³º'Vö šdÕù25zxܰ=Ò250ÿGÐŒÀd9òœá7PÈJvÃÌù³žÍ¶Â{fÓµðÕ}Ÿw»³(Lçµl@9=œ©Ý¶|äÂÀÒ^Íu€ËžyÉ«ÍX¿Ä'tŽÎÇSjÄ]ððvOtT²tž³
a®ÒÔ G{®ŠßϬ0BRïó;
¬ô#Ïì¡èý¬îOõ°Ý5Ô£¶]ÚvùðåÍóé;e:·UÀNn¡C pù÷:y1E\
°÷êÝ4WšøÖ·;[%nåÛÕPàFÂo¹m?²¬éG~';¿4^8(-ßb_×Y>W4žršh4Ðf=¹ÒÅ¥äÆÂï ówã
Içý[)ðÑ ¹€a;VLBdfÏÏTx)×G&¬êåSŸXe.÷n8Sîü]Àë)¥Â.²tÛ·ë
íŽhÎKkH[3º£EÕÐçµà9\Êã)=÷ôò¶
äÏFãÆ*äêãf<¥çñB}&žÒúãóW;Ïašè;Æ©O"éš¿ºNM ,Ê_š"§Hm4M"Ú¯µŒ·=`váL€h;|êÁ¬DÒDÄuš®@%ۡ³FµàŒüáËó¶ëùÆîP5;ªpÙ×IàvE©yv`alìCcϪyÁš;è¢Ú+
7Óf,y
öÀÍ®3Ps Ð.gÕ?âæ:IFÏ ¬éÅà[·×`(7á|_ŠôMFÈ=šÄ¥}ª`#ÒŽì¹¶
GWeBËzŠÅJÒÍÉt$ýÉ÷ä6¢<Z¿·QËÏFÝQ°Çb,j?aÊYº;m
*à©ðx
i7±ÊShOðyñåRŒZpV É®«ŠÛdë®èú€an§è<(,a~)]§Xôc^ñEIIÜHmuXJ,GP0`ÒušR,¡ÎTiªÓe<êÂ?/ÏÚGqNÊ[¯²Þ
©(ãÔ9²tð|eðlðO ZI!]c²GË\e»óÌFwT¡€Oǯé&>ðËJxÒ©ÞDß)Ae!€Á"o¢$ÜÞv§{tg¡ÔÚÂõ€?µ?¥ÔTÄC±éŽ©íÌAbðJç6ùb¡ÖÛî\ìYŽÌ¶*®T¥g@·Êwµ!-ÊbCZSëowÒÎ%V·V(-1ñþÔŒ£
¡º9·J§6yrV€ÒÊ=뻚ºbŒ?µJÿ³Œâ[ÔBtÊ
?'ÊtŠò_+:)9ZW"»IÁÈ<Ää#Ùjº$ïUN÷ºõ¿
Ì¢>HxxÒ¥3íEevz^ï 1H€WÅz!ðÿJw(§oÅT"«ÀÒíÐåô£J»ÎØïÕìõŽzœ{°,ÊÔ,ÜKåw ÙkùhÉÞ¡TfFjV9MLÉL%ËŒV2µŽ°8ÙíÉÜ7y:yÖOðJ!uVöeû&¢ü.2z=¹á`;œ}Ôj^)ÒÝn×µ ä©ù#_ß*Ðp"DG¬è»Á£?MzäÐ\)e#ó±(ý|9GI*O-UTëÝÕnô;4:2âr!¿H°ØÈÕ_õ=¥/ºâjØ;ÙÙ¡Ä>4üó×êÔ9È`ãÛ±a뀷«M§M#éN~ ÖkmŽgznhÛ*~DÚç"β)í`n`pư>g=[eÒè
*eÄ/¯_ýw£[
endstream
endobj
108 0 obj
<<
/ProcSet [/PDF /Text ]
/Font <<
/F1 54 0 R
/F2 55 0 R
/F3 87 0 R
/F6 90 0 R
>>
/ExtGState <<
/GS1 56 0 R
>>
>>
endobj
110 0 obj
<<
/D [109 0 R /XYZ null null null]
>>
endobj
94 0 obj
<<
/P 92 0 R
/R [63 63 549 693]
/V 60 0 R
/N 111 0 R
>>
endobj
112 0 obj
<<
/D [109 0 R /XYZ 71 687 null]
>>
endobj
113 0 obj
<<
/D [109 0 R /XYZ 71 666 null]
>>
endobj
114 0 obj
<<
/D [109 0 R /XYZ 71 603 null]
>>
endobj
115 0 obj
<<
/D [109 0 R /XYZ 71 540 null]
>>
endobj
116 0 obj
<<
/D [109 0 R /XYZ 71 522 null]
>>
endobj
117 0 obj
<<
/D [109 0 R /XYZ 71 504 null]
>>
endobj
118 0 obj
<<
/D [109 0 R /XYZ 71 486 null]
>>
endobj
119 0 obj
<<
/D [109 0 R /XYZ 71 468 null]
>>
[2065 lines skipped]
1
0
Update of /project/cells/cvsroot/cells
In directory clnet:/tmp/cvs-serv11564
Modified Files:
cells-test.asd cells.asd
Log Message:
fix ASDF issues
--- /project/cells/cvsroot/cells/cells-test.asd 2006/03/18 00:15:40 1.3
+++ /project/cells/cvsroot/cells/cells-test.asd 2006/03/19 00:28:38 1.4
@@ -10,6 +10,7 @@
:serial t
:depends-on (:cells)
:components ((:module "cells-test"
+ ;;:serial t
:components ((:file "test")
(:file "hello-world")
(:file "test-kid-slotting")
--- /project/cells/cvsroot/cells/cells.asd 2006/03/16 05:28:28 1.2
+++ /project/cells/cvsroot/cells/cells.asd 2006/03/19 00:28:38 1.3
@@ -6,12 +6,11 @@
(asdf:defsystem :cells
:name "cells"
- :author "Kenny Tilton <ktilton(a)nyc.rr.com>"
- :version "2.0"
- :maintainer "Kenny Tilton <ktilton(a)nyc.rr.com>"
+ :author "Kenny Tilton <kentilton(a)gmail.com>"
+ :maintainer "Kenny Tilton <kentilton(a)gmail.com>"
:licence "MIT Style"
:description "Cells"
- :long-description "The Cells dataflow extension to CLOS."
+ :long-description "Cells: a dataflow extension to CLOS."
:serial t
:components ((:module "utils-kt"
:serial t
@@ -24,10 +23,10 @@
(:file "defpackage")
(:file "cells")
(:file "integrity")
+ (:file "constructors")
(:file "cell-types")
(:file "synapse")
(:file "synapse-types")
- (:file "constructors")
(:file "initialize")
(:file "md-slot-value")
(:file "slot-utilities")
1
0
Update of /project/cells/cvsroot/cells
In directory clnet:/tmp/cvs-serv852
Modified Files:
cells-test.asd cells.lpr initialize.lisp integrity.lisp
model-object.lisp propagate.lisp
Log Message:
New doc and test (deep-cells) for Cells 3. One mod to avoid unnecessary :etll-dependents enqueue
--- /project/cells/cvsroot/cells/cells-test.asd 2006/03/16 05:28:28 1.2
+++ /project/cells/cvsroot/cells/cells-test.asd 2006/03/18 00:15:40 1.3
@@ -20,7 +20,8 @@
(:file "output-setf")
(:file "test-cycle")
(:file "test-ephemeral")
- (:file "test-synapse")))))
+ (:file "test-synapse")
+ (:file "deep-cells")))))
(defmethod perform :after ((op load-op) (system (eql (find-system :cells-test))))
(funcall (find-symbol "TEST-CELLS" "CELLS")))
--- /project/cells/cvsroot/cells/cells.lpr 2006/03/16 05:28:28 1.7
+++ /project/cells/cvsroot/cells/cells.lpr 2006/03/18 00:15:40 1.8
@@ -49,7 +49,7 @@
:old-space-size 256000
:new-space-size 6144
:runtime-build-option :standard
- :on-initialization 'cells::test-cells
+ :on-initialization 'cells::go-deep
:on-restart 'do-default-restart)
;; End of Project Definition
--- /project/cells/cvsroot/cells/initialize.lisp 2006/03/16 05:28:28 1.2
+++ /project/cells/cvsroot/cells/initialize.lisp 2006/03/18 00:15:40 1.3
@@ -34,14 +34,14 @@
(defmethod c-awaken-cell ((c cell))
(assert (c-inputp c))
- (when (and (c-ephemeral-p c)
+ #+goforit(when (and (c-ephemeral-p c)
(c-value c))
(c-break "Feature not yet supported: initializing ephemeral to other than nil: [~a]"
(c-value c)))
;
; nothing to calculate, but every cellular slot should be output
;
- (slot-change (c-slot-name c) (c-model c) (c-value c) nil nil)
+ (slot-value-observe (c-slot-name c) (c-model c) (c-value c) nil nil)
(c-ephemeral-reset c))
(defmethod c-awaken-cell ((c c-ruled))
--- /project/cells/cvsroot/cells/integrity.lisp 2006/03/16 05:28:28 1.5
+++ /project/cells/cvsroot/cells/integrity.lisp 2006/03/18 00:15:40 1.6
@@ -80,29 +80,69 @@
(tagbody
tell-dependents
(just-do-it :tell-dependents)
-
- (just-do-it :awaken) ;--- awaken new instances ---
+ ;
+ ; while the next step looks separate from the prior, they are closely bound.
+ ; during :tell-dependents, any number of new model instances can be spawned.
+ ; as they are spawned, shared-initialize queues them for awakening, which
+ ; you will recall forces the calculation of ruled cells and observer notification
+ ; for all cell slots. These latter may enqueue :change or :client tasks, in which
+ ; case note that they become appended to :change or :client tasks enqueued
+ ; during :tell-dependents. How come? Because the birth itself of model instances during
+ ; a datapulse is considered part of that datapulse, so we do want tasks enqueued
+ ; during their awakening to be handled along with those enqueued by cells of
+ ; existing model instances.
+ ;
+ (just-do-it :awaken) ;--- md-awaken new instances ---
+ ;
+ ; we do not go back to check for a need to :tell-dependents because (a) the original propagation
+ ; and processing of the :tell-dependents queue is a full propagation; no rule can ask for a cell that
+ ; then decides it needs to recompute and possibly propagate; and (b) the only rules forced awake during
+ ; awakening need that precisely because no one asked for their values, so their can be no dependents
+ ; to "tell". I think. :) So...
+ ;
+ (assert (null (fifo-peek (ufb-queue :tell-dependents))))
;--- process client queue ------------------------------
;
(when *stop* (return-from finish-business))
- (trc (fifo-peek (ufb-queue :client)) "!!! finbiz --- USER --- length" (fifo-length (ufb-queue :client)))
-
+
(bwhen (clientq (ufb-queue :client))
(if *client-queue-handler*
- (funcall *client-queue-handler* clientq) ;; might be empty/not exist
+ (funcall *client-queue-handler* clientq) ;; might be empty/not exist, so handlers must check
(just-do-it clientq)))
;--- now we can reset ephemerals --------------------
+ ;
+ ; one might be wondering when the observers got notified. That happens
+ ; Nice historical note: by accident, in the deep-cells test to exercise the new behavior
+ ; of cells3, I coded an ephemeral cell and initialized it to non-nil, hitting a runtime
+ ; error (now gone) saying I had no idea what a non-nil ephemeral would mean. That had been
+ ; my conclusion when the idea occurred to me the first time, so I stuck in an assertion
+ ; to warn off users.
+ ;
+ ; But the new
+ ; datachange progression defined by Cells3 had already forced me to manage ephemeral resets
+ ; more predictably (something in the test suite failed). By the time I got the runtime
+ ; error on deep-cells I was able to confidently take out the error and just let the thing
+ ; run. deep-cells looks to behave just right, but maybe a tougher test will present a problem?
+ ;
(just-do-it :ephemeral-reset)
;--- do deferred state changes -----------------------
;
- (bwhen (task-info (fifo-pop (ufb-queue :change))) ;; it would be odd, but nils can legally inhabit queues, so be safe...
+ (bwhen (task-info (fifo-pop (ufb-queue :change)))
(trc nil "!!!!!!!!!!!!!!!!!!! finbiz --- CHANGE ---- (first of)" (fifo-length (ufb-queue :change)))
(destructuring-bind (defer-info . task-fn) task-info
(trc nil "finbiz: deferred state change" defer-info)
(data-pulse-next (list :finbiz defer-info))
(funcall task-fn)
+ ;
+ ; to finish this state change we could recursively call (finish-business), but
+ ; a goto let's us not use the stack. Someday I envision code that keeps on
+ ; setf-ing, polling the OS for events, in which case we cannot very well use
+ ; recursion. But as a debugger someone might want to change the next form
+ ; to (finish-business) if they are having trouble with a chain of setf's and
+ ; want to inspect the history on the stack.
+ ;
(go tell-dependents)))))
--- /project/cells/cvsroot/cells/model-object.lisp 2006/03/16 05:28:28 1.3
+++ /project/cells/cvsroot/cells/model-object.lisp 2006/03/18 00:15:40 1.4
@@ -133,7 +133,7 @@
;; but I think anything better creates a run-time hit.
;;
(unless (md-slot-cell-flushed self slot-name) ;; slot will have been propagated just after cell was flushed
- (slot-change slot-name self (bd-slot-value self slot-name) nil nil)))
+ (slot-value-observe slot-name self (bd-slot-value self slot-name) nil nil)))
((find (c-lazy c) '(:until-asked :always t))
(trc nil "md-awaken deferring c-awaken since lazy"
--- /project/cells/cvsroot/cells/propagate.lisp 2006/03/16 05:28:28 1.9
+++ /project/cells/cvsroot/cells/propagate.lisp 2006/03/18 00:15:40 1.10
@@ -85,7 +85,7 @@
; --- manifest new value as needed ---
;
- ; propagation to users jumps back in front of client slot-change handling in cells3
+ ; propagation to users jumps back in front of client slot-value-observe handling in cells3
; because model adopting (once done by the kids change handler) can now be done in
; shared-initialize (since one is now forced to supply the parent to make-instance).
;
@@ -95,13 +95,13 @@
;
(c-propagate-to-users c)
- (slot-change (c-slot-name c) (c-model c)
+ (slot-value-observe (c-slot-name c) (c-model c)
(c-value c) prior-value prior-value-supplied)
;
; with propagation done, ephemerals can be reset. we also do this in c-awaken, so
; let the fn decide if C really is ephemeral. Note that it might be possible to leave
; this out and use the datapulse to identify obsolete ephemerals and clear them
- ; when read. That would avoid ever making again bug I had in which I had the reset inside slot-change,
+ ; when read. That would avoid ever making again bug I had in which I had the reset inside slot-value-observe,
; thinking that that always followed propagation to users. It would also make
; debugging easier in that I could find the last ephemeral value in the inspector.
; would this be bad for persistent CLOS, in which a DB would think there was still a link
@@ -112,14 +112,6 @@
; --- slot change -----------------------------------------------------------
-(defun slot-change (slot-name self new-value prior-value prior-value-supplied)
- (trc nil "slot-change > now!!" self slot-name new-value prior-value)
- ;; (count-it :output slot-name)
- ;
- ; this next guy is a GF with progn method combo, which is why we cannot just use slot-change
- ;
- (slot-value-observe slot-name self new-value prior-value prior-value-supplied))
-
(defmacro defobserver (slotname
(&optional (self-arg 'self) (new-varg 'new-value)
(oldvarg 'old-value) (oldvargboundp 'old-value-boundp))
@@ -172,15 +164,16 @@
; there is no way one can reliably be sure H will not ask for A
;
(trc nil "c-propagate-to-users > queueing" c)
- (let ((causation (cons c *causation*))) ;; in case deferred
- (with-integrity (:tell-dependents c)
- (assert (null *c-calculators*))
- (let ((*causation* causation))
- (trc nil "c-propagate-to-users > notifying users of" c)
- (dolist (user (c-users c))
- (unless (member (cr-lazy user) '(t :always :once-asked))
- (trc nil "propagating to user is (used,user):" c user)
- (c-value-ensure-current user :user-propagation)))))))
+ (when (c-users c)
+ (let ((causation (cons c *causation*))) ;; in case deferred
+ (with-integrity (:tell-dependents c)
+ (assert (null *c-calculators*))
+ (let ((*causation* causation))
+ (trc nil "c-propagate-to-users > notifying users of" c)
+ (dolist (user (c-users c))
+ (unless (member (cr-lazy user) '(t :always :once-asked))
+ (trc nil "propagating to user is (used,user):" c user)
+ (c-value-ensure-current user :user-propagation))))))))
1
0
Update of /project/cells/cvsroot/cells/cells-test
In directory clnet:/tmp/cvs-serv31950/Cells-test
Modified Files:
cells-test.lpr
Added Files:
deep-cells.lisp
Log Message:
New deep-cells.lisp to demo Cells 3
--- /project/cells/cvsroot/cells/cells-test/cells-test.lpr 2006/03/16 05:22:08 1.3
+++ /project/cells/cvsroot/cells/cells-test/cells-test.lpr 2006/03/18 00:14:01 1.4
@@ -15,7 +15,8 @@
(make-instance 'module :name "output-setf.lisp")
(make-instance 'module :name "test-cycle.lisp")
(make-instance 'module :name "test-ephemeral.lisp")
- (make-instance 'module :name "test-synapse.lisp"))
+ (make-instance 'module :name "test-synapse.lisp")
+ (make-instance 'module :name "deep-cells.lisp"))
:projects (list (make-instance 'project-module :name "..\\cells"))
:libraries nil
:distributed-files nil
--- /project/cells/cvsroot/cells/cells-test/deep-cells.lisp 2006/03/18 00:14:01 NONE
+++ /project/cells/cvsroot/cells/cells-test/deep-cells.lisp 2006/03/18 00:14:01 1.1
(defvar *client-log*)
(defvar *obs-1-count*)
(defmodel deep ()
((cell-2 :cell :ephemeral :initform (c-in 'two) :accessor :cell-2)
(cell-1 :initform (c? (list 'one (^cell-2) (^cell-3))) :accessor :cell-1)
(cell-3 :initform (c-in 'c3-unset) :accessor :cell-3)))
(defobserver cell-1 ()
(trc "cell-1 observer raw now enqueing client to run first. (new,old)=" new-value old-value)
(with-integrity (:client 1)
(trc "cell-1 :client now running" new-value (incf *obs-1-count*))
(eko ("c1-obs->*client-log*: ")
(setf *client-log* (list new-value)))))
(defobserver cell-2 ()
(trc "cell-2 observer raw now enqueing change and client to run second. (new,old)=" new-value old-value)
(with-integrity (:change)
(trc "cell-2 observer :change now running" *client-log*)
(ct-assert (equal *client-log* '((one two c3-unset) two c3-unset)))
(setf (^cell-3) (case new-value (two 'three) (otherwise 'trouble))))
(with-integrity (:client 2)
(trc "client cell-2 :client running")
(eko ("c2-obs->*client-log*: ")
(setf *client-log* (append *client-log* (list new-value))))))
(defobserver cell-3 ()
(trc "cell-3 observer raw now enqueing client to run third. (new,old)=" new-value old-value)
(with-integrity (:client 3)
(trc "cell-3 observer :client now running" new-value)
(eko ("c3-obs->*client-log*: ")
(setf *client-log* (append *client-log* (list new-value))))))
(defun deep-queue-handler (client-q)
(loop for (nil . task) in (prog1
(sort (fifo-data client-q) '< :key 'car)
(fifo-clear client-q))
do
(trc nil "!!! --- deep-queue-handler dispatching" defer-info)
(funcall task)))
(def-cell-test go-deep ()
(cells-reset 'deep-queue-handler)
(setf *obs-1-count* 0)
(make-instance 'deep)
(ct-assert (eql 2 *obs-1-count*)) ;; because the cell-2 observer does a setf on something used by c1
(trc "testing *client-log*" *client-log*)
(ct-assert (tree-equal *client-log* '((one nil three) three))))
1
0
Update of /project/cells/cvsroot/cells/utils-kt
In directory clnet:/tmp/cvs-serv23261/utils-kt
Modified Files:
debug.lisp defpackage.lisp detritus.lisp strings.lisp
utils-kt.lpr
Log Message:
Cells 3 support
--- /project/cells/cvsroot/cells/utils-kt/debug.lisp 2005/09/26 15:36:05 1.5
+++ /project/cells/cvsroot/cells/utils-kt/debug.lisp 2006/03/16 05:26:47 1.6
@@ -55,7 +55,7 @@
(assert (stringp ,(car os)))
(call-trc t ,@os)) ;;,(car os) ,tgt ,@(cdr os)))
(progn
- (break "trcfailed")
+ ;; (break "trcfailed")
(count-it :trcfailed)))
(count-it :tgtnileval)))))))
--- /project/cells/cvsroot/cells/utils-kt/defpackage.lisp 2005/05/06 21:05:56 1.1
+++ /project/cells/cvsroot/cells/utils-kt/defpackage.lisp 2006/03/16 05:26:47 1.2
@@ -38,9 +38,11 @@
#:intern$
#:define-constant #:*count* #:*stop*
#:*dbg* #:*trcdepth*
- #:make-fifo-queue #:fifo-add #:fifo-empty #:fifo-pop #:mapfifo
+ #:make-fifo-queue #:fifo-queue #:fifo-add #:fifo-delete
+ #:fifo-empty #:fifo-pop #:fifo-clear
+ #:fifo-map #:fifo-peek #:fifo-data #:with-fifo-map #:fifo-length
- #-mcl #:true
+ #-(or lispworks mcl) #:true
#+clisp #:slot-definition-name
#+(and mcl (not openmcl-partial-mop)) #:class-slots
-))
+ ))
--- /project/cells/cvsroot/cells/utils-kt/detritus.lisp 2005/09/26 15:36:05 1.2
+++ /project/cells/cvsroot/cells/utils-kt/detritus.lisp 2006/03/16 05:26:47 1.3
@@ -42,7 +42,7 @@
(copy-list (class-instance-slots c))))
-#-(or mcl)
+#-(or lispworks mcl)
(progn
(defun true (it) (declare (ignore it)) t)
(defun false (it) (declare (ignore it))))
@@ -50,7 +50,22 @@
(defun xor (c1 c2)
(if c1 (not c2) c2))
-(defun make-fifo-queue () (cons nil nil))
+;;; --- FIFO Queue -----------------------------
+
+(defun make-fifo-queue (&rest init-data)
+ (let ((q (cons nil nil)))
+ (prog1 q
+ (loop for id in init-data
+ do (fifo-add q id)))))
+
+(deftype fifo-queue () 'cons)
+
+(defun fifo-data (q) (car q))
+(defun fifo-clear (q) (rplaca q nil))
+(defun fifo-empty (q) (not (fifo-data q)))
+(defun fifo-length (q) (length (fifo-data q)))
+(defun fifo-peek (q) (car (fifo-data q)))
+
(defun fifo-add (q new)
(if (car q)
(let ((last (cdr q))
@@ -60,23 +75,37 @@
(let ((newlist (list new)))
(rplaca q newlist)
(rplacd q newlist))))
-(defun fifo-queue (q) (car q))
-(defun fifo-empty (q) (not (car q)))
+
+(defun fifo-delete (q dead)
+ (let ((c (member dead (fifo-data q))))
+ (assert c)
+ (rplaca q (delete dead (fifo-data q)))
+ (when (eq c (cdr q))
+ (rplacd q (last (fifo-data q))))))
+
(defun fifo-pop (q)
- (prog1
- (caar q)
- (rplaca q (cdar q))))
+ (unless (fifo-empty q)
+ (prog1
+ (fifo-peek q)
+ (rplaca q (cdar q)))))
-(defun mapfifo (fn q)
+(defun fifo-map (q fn)
(loop until (fifo-empty q)
do (funcall fn (fifo-pop q))))
+(defmacro with-fifo-map ((pop-var q) &body body)
+ (let ((qc (gensym)))
+ `(loop with ,qc = ,q
+ while (not (fifo-empty ,qc))
+ do (let ((,pop-var (fifo-pop ,qc)))
+ ,@body))))
+
#+(or)
(let ((*print-circle* t))
(let ((q (make-fifo-queue)))
(loop for n below 3
do (fifo-add q n))
- (fifo-queue q)
+ (fifo-delete q 1)
(loop until (fifo-empty q)
do (print (fifo-pop q)))))
@@ -93,3 +122,39 @@
(symbol-value ',name)
value)))
,@(when docstring (list docstring))))
+
+#+allegro
+(defun line-count (path &optional show-files (depth 0))
+ (cond
+ ((excl:file-directory-p path)
+ (when show-files
+ (format t "~&~v,8t~a counts:" depth (pathname-directory path)))
+ (let ((directory-lines
+ (loop for file in (directory path :directories-are-files nil)
+ for lines = (line-count file show-files (1+ depth))
+ when (and show-files (plusp lines))
+ do (bwhen (fname (pathname-name file))
+ (format t "~&~v,8t~a ~,40t~d" (1+ depth) fname lines))
+ summing lines)))
+ (format t "~&~v,8t~a ~,50t~d" depth (pathname-directory path) directory-lines)
+ directory-lines))
+
+ ((find (pathname-type path) '("cl" "lisp" "c" "h" "java")
+ :test 'string-equal)
+ (source-line-count path))
+ (t 0)))
+
+(defun source-line-count (path)
+ (with-open-file (s path)
+ (loop with lines = 0
+ for c = (read-char s nil nil)
+ while c
+ when (find c '(#\newline #\return))
+ do (incf lines)
+ finally (return lines))))
+
+#+(or)
+(line-count (make-pathname
+ :device "c"
+ :directory `(:absolute "0dev" "Algebra")) t)
+
--- /project/cells/cvsroot/cells/utils-kt/strings.lisp 2005/09/26 15:36:05 1.2
+++ /project/cells/cvsroot/cells/utils-kt/strings.lisp 2006/03/16 05:26:47 1.3
@@ -159,7 +159,7 @@
(down$ s))
(defun down$ (s)
- (typecase s
+ (etypecase s
(null "")
(string (string-downcase s))
(number (format nil "~a" s))
--- /project/cells/cvsroot/cells/utils-kt/utils-kt.lpr 2005/09/26 15:05:43 1.4
+++ /project/cells/cvsroot/cells/utils-kt/utils-kt.lpr 2006/03/16 05:26:47 1.5
@@ -1,9 +1,9 @@
-;; -*- lisp-version: "7.0 [Windows] (Sep 4, 2005 16:25)"; cg: "1.54.2.17"; -*-
+;; -*- lisp-version: "8.0 [Windows] (Mar 7, 2006 20:04)"; cg: "1.81"; -*-
(in-package :cg-user)
(defpackage :COMMON-LISP
- (:export #:list
+ (:export #:list
#:make-instance
#:t
#:nil
@@ -12,9 +12,10 @@
(define-project :name :utils-kt
:modules (list (make-instance 'module :name "defpackage.lisp")
(make-instance 'module :name "debug.lisp")
- (make-instance 'module :name "detritus.lisp")
(make-instance 'module :name "flow-control.lisp")
- (make-instance 'module :name "strings.lisp"))
+ (make-instance 'module :name "detritus.lisp")
+ (make-instance 'module :name "strings.lisp")
+ (make-instance 'module :name "datetime.lisp"))
:projects nil
:libraries nil
:distributed-files nil
1
0
Update of /project/cells/cvsroot/cells/doc
In directory clnet:/tmp/cvs-serv23131/doc
Modified Files:
01-Cell-basics.lisp
Added Files:
motor-control.lisp
Log Message:
Cells 3 revision to 01-Cell-basics.lisp, and Bill Clementson's motor-control.lisp / Blog entry
--- /project/cells/cvsroot/cells/doc/01-Cell-basics.lisp 2005/05/06 21:05:55 1.1
+++ /project/cells/cvsroot/cells/doc/01-Cell-basics.lisp 2006/03/16 05:24:41 1.2
@@ -1,16 +1,8 @@
-;; -*- mode: Lisp; Syntax: Common-Lisp; Package: cellsS -*-
+;; -*- mode: Lisp; Syntax: Common-Lisp; Package: cells -*-
;;;
;;; Copyright (c) 1995,2003 by Kenneth William Tilton.
;;;
-;;; Permission is hereby granted, free of charge, to any person obtaining a copy
-;;; of this software and associated documentation files (the "Software"), to deal
-;;; in the Software without restriction, including without limitation the rights
-;;; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-;;; copies of the Software, and to permit persons to whom the Software is furnished
-;;; to do so, subject to the following conditions:
-;;;
-;;; The above copyright notice and this permission notice shall be included in
-;;; all copies or substantial portions of the Software.
+;;; All rights reserved.
;;;
;;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
;;; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
@@ -25,18 +17,7 @@
#|
-here is a minimal primer on cells, just enough for you to
-keep up with the next tutorial. that will be a substantial project
-in which we develop a clos object inspector.
-
-the inspector project will give you a feel for what it is like to
-program with cells and cello /after/ you are fluent in the
-technology. the intent is not to teach you cello, rather to
-motivate your learning it.
-
-so why the primer on cells? if things like c? and cv and def-c-output
-do not mean anything to you, the hunh? factor will be overwhelming.
-
+[A minimal primer on cells, last tested on march 13, 2006 against cells3]
cells
-----
@@ -130,6 +111,9 @@
(in-package :cells)
+(cells-reset)
+
+
(defmodel stone ()
((accel :cell t :initarg :accel :initform 0 :accessor accel)
(time-elapsed :cell t :initarg :time-elapsed
@@ -141,14 +125,14 @@
(expt (time-elapsed self) 2))
2))))
-(def-c-output accel ((self stone) new old old-bound-p)
- (trc "echo accel" :new new :old old :oldp old-bound-p)) ;; TRC provides print diagnostics
+(defobserver accel ((self stone) new old old-bound-p)
+ (trc "observer sees accel" :new new :old old :oldp old-bound-p)) ;; TRC provides print diagnostics
-(def-c-output time-elapsed ((self stone)) ;; short form (I'm lazy)
- (trc "echo time-elapsed" :new new-value :old old-value :oldp old-value-boundp))
+(defobserver time-elapsed ((self stone)) ;; short form (I'm lazy)
+ (trc "observer sees time-elapsed" :new new-value :old old-value :oldp old-value-boundp))
-(def-c-output distance ((self stone))
- (format t "~&echo distance fallen: ~d feet" new-value))
+(defobserver distance ((self stone))
+ (format t "~&observer sees distance fallen: ~d feet" new-value))
#|
@@ -202,48 +186,30 @@
cell internals enforce this, simply to make possible the optimization
of leaving off the overhead of recording a pointless dependency.
-next: (def-c-output...
+next: (defobserver...
-here is the signature for the def-c-output macro:
+here is the signature for the defobserver macro:
- (defmacro def-c-output (slotname (&optional (self-arg 'self)
+ (defmacro defobserver (slotname (&optional (self-arg 'self)
(new-varg 'new-value)
(oldvarg 'old-value)
(oldvargboundp 'old-value-boundp))
- &body echo-body) ....)
+ &body observer-body) ....)
-def-c-output defines a generic method one can specialize on any of the four
+defobserver defines a generic method with method-combination progn,
+which one can specialize on any of the four
parameters. the method gets called when the slot value changes, and during
-initial processing by:
+initial processing by shared-initialize (part of make-instance).
- (to-be....)
-
-to-be brings a new model instance to life, including calling
-any echos defined for cellular slots.
-
-why not just do this in initialize-instance? we build complex
-models in the form of a tree of many model instances, any of
-which may depend on some other model instance to calculate
-some part of its state. models find the one they are curious
-about by searching the tree.
-
-this means we cannot just bring a model instance to life at
-make-instance time; some cell rule may go looking for another
-model instance. we must wait until the instance is
-embedded in the larger model tree, then we can kick off to-be.
-
-likewise, when we yank an instance from the larger model we
-will call not-to-be on it.
-
-the good news is that unless i am doing little tutorial examples
-i never think about calling to-be. trees are implemented in part
-by a "kids" (short for "children") cell. the echo on that cell
-calls to-be on new kids and not-to-be on kids no longer in the list.
+shared-initialize brings a new model instance to life, including calling
+any observers defined for cellular slots.
now evaluate the following:
|#
+#+evaluatethis
+
(defparameter *s2* (make-instance 'stone
:accel 32 ;; (constant) feet per second per second
:time-elapsed (c-in 0)))
@@ -251,16 +217,15 @@
#|
...and observe:
-0> echo accel :new 32 :old nil :oldp nil
-0> echo time-elapsed :new 0 :old nil :oldp nil
-echo distance fallen: 0 feet
+0> observer sees accel :new 32 :old nil :oldp nil
+0> observer sees time-elapsed :new 0 :old nil :oldp nil
+observer sees distance fallen: 0 feet
-getting back to the output shown above, why echo output on a new instance?
-
-when we call to-be we want the instance to come to life. that means
+getting back to the output shown above, why observer output on a new instance? we want
+any new instance to come fully to life. that means
evaluating every rule so the dependencies get established, and
-propagating cell values outside the model (by calling the echo
+propagating cell values outside the model (by calling the observer
methods) to make sure the model and outside world (if only the
system display) are consistent.
@@ -269,16 +234,18 @@
|#
+#+evaluatethis
+
(setf (time-elapsed *s2*) 1)
#|
...and observe:
-0> echo time-elapsed :new 1 :old 0 :oldp t
-echo distance fallen: 16 feet
+0> observer sees time-elapsed :new 1 :old 0 :oldp t
+observer sees distance fallen: 16 feet
behind the scenes:
- the slot value time-elapsed got changed from 0 to 1
-- the time-elapsed echo was called
+- the time-elapsed observer was called
- dependents on time-elapsed (here just distance) were recalculated
- go to the first step, this time for the distance slot
@@ -287,7 +254,9 @@
the same value it already has:
|#
-(setf (time-elapsed *s2*) 1)
+#+evaluatethis
+
+(setf (time-elapsed *s2*) 1)
#| observe:
nothing, since the slot-value did not in fact change.
@@ -297,30 +266,42 @@
modifying cells holding naked values:
|#
-(handler-case
- (setf (accel *s2*) 10)
- (t (error) (trc "error is" error)
- error))
+#+evaluatethis
+
+(let ((*c-debug* t))
+ (handler-case
+ (setf (accel *s2*) 10)
+ (t (error)
+ (cells-reset) ;; clear a *stop* flag used to bring down a runaway model :)
+ (trc "error is" error)
+ error)))
#| observe:
c-setting-debug > constant accel in stone may not be altered..init to (c-in nil)
0> error is #<simple-error @ #x210925f2>
+Without turning on *c-debug* one just gets the runtime error, not the explanation to standard output.
+
;-----------------------------------------------------------
nor may ruled cells be modified arbitrarily:
|#
-(handler-case
+#+evaluatethis
+
+(let ((*c-debug* t))
+ (handler-case
(setf (distance *s2*) 42)
- (t (error) (trc "error is" error)
- error))
+ (t (error)
+ (cells-reset)
+ (trc "error is" error)
+ error)))
#| observe:
c-setting-debug > ruled distance in stone may not be setf'ed
0> error is #<simple-error @ #x2123e392>
;-----------------------------------------------------------
-aside from c?, cv, and def-c-output, another thing you will see
+aside from c?, cv, and defobserver, another thing you will see
in cello code is how complex views are constructed using
the family class and its slot kids. every model-object has a
parent slot, which gets used along with a family's kids slot to
@@ -337,10 +318,10 @@
silly examples. all i want to get across is that a lot happens
when one changes the kids slot. it happens automatically, and
it happens transparently, following the dataflow implicit in the
-rules we write, and the side-effects we specify via echo functions.
+rules we write, and the side-effects we specify via observer functions.
the silly example below just shows the summer (that which sums) getting
-a new md-value as the kids change, along with some echo output. in real-world
+a new md-value as the kids change, along with some observer output. in real-world
applications, where kids represent gui elements often dependent on
each other, vastly more can transpire before a simple push into a kids
slot has run its course.
@@ -356,16 +337,18 @@
:initial-value 0
:key #'md-value))))
-(def-c-output .md-value ((self summer))
+(defobserver md-value ((self summer))
(trc "the sum of the values of the kids is" new-value))
-(def-c-output .kids ((self summer))
+(defobserver .kids ((self summer))
(trc "the values of the kids are" (mapcar #'md-value new-value)))
;-----------------------------------------------------------
; now just evaluate each of the following forms one by one,
; checking results after each to see what is going on
;
+#+evaluatethis
+
(defparameter *f1* (make-instance 'summer))
#|
@@ -375,7 +358,11 @@
;----------------------------------------------------------|#
-(push (make-instance 'model :md-value 1) (kids *f1*))
+#+evaluatethis
+
+(push (make-instance 'model
+ :fm-parent *f1*
+ :md-value 1) (kids *f1*))
#| observe:
0> the values of the kids are (1)
@@ -383,7 +370,11 @@
;----------------------------------------------------------|#
-(push (make-instance 'model :md-value 2) (kids *f1*))
+#+evaluatethis
+
+(push (make-instance 'model
+ :fm-parent *f1*
+ :md-value 2) (kids *f1*))
#| observe:
0> the values of the kids are (2 1)
@@ -391,6 +382,8 @@
;----------------------------------------------------------|#
+#+evaluatethis
+
(setf (kids *f1*) nil)
#| observe:
@@ -403,6 +396,8 @@
|#
+#+evaluatethis
+
(setq *s2* (make-instance 'stone
:accel 2
:time-elapsed (c-in 3)
--- /project/cells/cvsroot/cells/doc/motor-control.lisp 2006/03/16 05:24:41 NONE
+++ /project/cells/cvsroot/cells/doc/motor-control.lisp 2006/03/16 05:24:41 1.1
;; -*- mode: Lisp; Syntax: Common-Lisp; Package: cells -*-
;;;
;;; Copyright © 2004 by Bill Clementson
;;;
;;; Reprinted, reformatted, and modestly revised by permission.
;;;
;;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
;;; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
;;; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
;;; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
;;; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
;;; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
;;; IN THE SOFTWARE.
#|
Experimenting with Cells
----------------------------
Thursday, September 11, 2003
Kenny Tilton has been talking about his Cells implementation on comp.lang.lisp for some time
but I've only just had a look at it over the past few evenings. It's actually pretty neat.
Kenny describes Cells as, conceptually, analogous to a spreadsheet cell (e.g. -- something
in which you can put a value or a formula and have it updated automatically based on changes
in other "cell" values). Another way of saying this might be that Cells allows you to define
classes whose slots can be dynamically (and automatically) updated and for which standard
observers can be defined that react to changes in those slots.
Hmmm, maybe an example works best. Here's one that's a variation on one of the examples
included in the latest distribution. I'll create a "motor" object that reacts to changes
in the motor's operating temperature. If the temperature exceeds 100 degrees, the motor will
need to be shut off. If it is shut off, the flow from the fuel pump will also need to be
closed (otherwise, we get a big pool of fuel on the floor).
So, by using Cells in this example, the following will be demonstrated:
* Create slots whose values vary based on a formula. The formula can be defined at
either class definition time or at object instantiation time.
* Dynamically (and automatically) update dependent slot variables (maintaining consistency
between dependent class attributes).
* Create Observers that react to changes in slot values to handle "external"
actions (e.g. - GUI updates, external API calls, etc.).
* Automatically filter slot changes so that we only update dependent slots
when the right granularity of change occurs.
First, define the motor class (Note: defmodel is a macro that wraps a class
definition and several method definitions):
|#
(defmodel motor ()
((status :initarg :status :accessor status :initform nil)
(fuel-pump :initarg :fuel-pump :accessor fuel-pump
:initform (c? (ecase (^status) (:on :open) (:off :closed))))
(temp :initarg :temp :accessor temp :initform (c-in 0))))
#|
Note that "status" is a cell with no initial value or formula, "fuel-pump" is
a cell that has a formula that depends on the value of "status" (the ^status notation
is shorthand to refer to a slot in the same instance), and "temp" is initialized to zero.
Next, define observers (this is an optional step) using a Cells macro.
These observers act on a change in a slot's value. They don't actually update
any dependent slots (this is done automatically by Cells and the programmer
doesn't have to explicitly call the slot updates), they just provide a mechanism
for the programmer to handle outside dependencies. In this example, we're just
printing a message; however, in a real program, we would be calling out to something
like an Allen Bradley controller to turn the motor and fuel pump on/off.
|#
(defobserver status ((self motor))
(trc "motor status changing from" old-value :to new-value))
(defobserver fuel-pump ((self motor))
(trc "motor fuel-pump changing from" old-value :to new-value))
(defobserver temp ((self motor))
(trc "motor temperature changing from" old-value :to new-value))
[67 lines skipped]
1
0
Update of /project/cells/cvsroot/Celtk
In directory clnet:/tmp/cvs-serv22087
Added Files:
CELTK.lpr Celtk.asd Celtk.lisp canvas.lisp composites.lisp
demos.lisp kt69.gif load.lisp ltk-kt.lisp menu.lisp
textual.lisp tk-format.lisp widgets.lisp
Log Message:
Initial release of a portable Common Lisp GUI, with Cells and LTk Inside
--- /project/cells/cvsroot/Celtk/CELTK.lpr 2006/03/16 05:15:14 NONE
+++ /project/cells/cvsroot/Celtk/CELTK.lpr 2006/03/16 05:15:14 1.1
;; -*- lisp-version: "8.0 [Windows] (Mar 7, 2006 20:04)"; cg: "1.81"; -*-
(in-package :cg-user)
(defpackage :CELTK)
(define-project :name :celtk
:modules (list (make-instance 'module :name "ltk-kt.lisp")
(make-instance 'module :name "notes.lisp")
(make-instance 'module :name "Celtk.lisp")
(make-instance 'module :name "tk-format.lisp")
(make-instance 'module :name "menu.lisp")
(make-instance 'module :name "composites.lisp")
(make-instance 'module :name "textual.lisp")
(make-instance 'module :name "widgets.lisp")
(make-instance 'module :name "canvas.lisp")
(make-instance 'module :name "demos.lisp"))
:projects (list (make-instance 'project-module :name
"..\\cells\\cells"))
:libraries nil
:distributed-files nil
:internally-loaded-files nil
:project-package-name :celtk
:main-form nil
:compilation-unit t
:verbose nil
:runtime-modules '(:cg-dde-utils :cg.base :cg.bitmap-pane
:cg.bitmap-pane.clipboard :cg.bitmap-stream
:cg.button :cg.caret :cg.check-box :cg.choice-list
:cg.choose-printer :cg.clipboard
:cg.clipboard-stack :cg.clipboard.pixmap
:cg.color-dialog :cg.combo-box :cg.common-control
:cg.comtab :cg.cursor-pixmap :cg.curve
:cg.dialog-item :cg.directory-dialog
:cg.directory-dialog-os :cg.drag-and-drop
:cg.drag-and-drop-image :cg.drawable
:cg.drawable.clipboard :cg.dropping-outline
:cg.edit-in-place :cg.editable-text
:cg.file-dialog :cg.fill-texture
:cg.find-string-dialog :cg.font-dialog
:cg.gesture-emulation :cg.get-pixmap
:cg.get-position :cg.graphics-context
:cg.grid-widget :cg.grid-widget.drag-and-drop
:cg.group-box :cg.header-control :cg.hotspot
:cg.html-dialog :cg.html-widget :cg.icon
:cg.icon-pixmap :cg.ie :cg.item-list
:cg.keyboard-shortcuts :cg.lamp :cg.lettered-menu
:cg.lisp-edit-pane :cg.lisp-text :cg.lisp-widget
:cg.list-view :cg.mci :cg.menu :cg.menu.tooltip
:cg.message-dialog :cg.multi-line-editable-text
:cg.multi-line-lisp-text :cg.multi-picture-button
:cg.multi-picture-button.drag-and-drop
:cg.multi-picture-button.tooltip :cg.ocx
:cg.os-widget :cg.os-window :cg.outline
:cg.outline.drag-and-drop
:cg.outline.edit-in-place :cg.palette
:cg.paren-matching :cg.picture-widget
:cg.picture-widget.palette :cg.pixmap
:cg.pixmap-widget :cg.pixmap.file-io
:cg.pixmap.printing :cg.pixmap.rotate :cg.printing
:cg.progress-indicator :cg.project-window
:cg.property :cg.radio-button :cg.rich-edit
:cg.rich-edit-pane :cg.rich-edit-pane.clipboard
:cg.rich-edit-pane.printing :cg.sample-file-menu
:cg.scaling-stream :cg.scroll-bar
:cg.scroll-bar-mixin :cg.selected-object
:cg.shortcut-menu :cg.static-text :cg.status-bar
:cg.string-dialog :cg.tab-control
:cg.template-string :cg.text-edit-pane
:cg.text-edit-pane.file-io :cg.text-edit-pane.mark
:cg.text-or-combo :cg.text-widget :cg.timer
:cg.toggling-widget :cg.toolbar :cg.tooltip
:cg.trackbar :cg.tray :cg.up-down-control
:cg.utility-dialog :cg.web-browser
:cg.web-browser.dde :cg.wrap-string
:cg.yes-no-list :cg.yes-no-string :dde)
:splash-file-module (make-instance 'build-module :name "")
:icon-file-module (make-instance 'build-module :name "")
:include-flags '(:top-level :debugger)
:build-flags '(:allow-runtime-debug :purify)
:autoload-warning t
:full-recompile-for-runtime-conditionalizations nil
:default-command-line-arguments "+M +t \"Console for Debugging\""
:additional-build-lisp-image-arguments '(:read-init-files nil)
:old-space-size 256000
:new-space-size 6144
:runtime-build-option :standard
:on-initialization 'celtk::tk-test
:on-restart 'do-default-restart)
;; End of Project Definition
--- /project/cells/cvsroot/Celtk/Celtk.asd 2006/03/16 05:15:14 NONE
+++ /project/cells/cvsroot/Celtk/Celtk.asd 2006/03/16 05:15:14 1.1
;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10 -*-
#+(or allegro lispworks cmu mcl clisp cormanlisp sbcl scl)
(progn
(declaim (optimize (debug 3) (speed 3) (safety 1) (compilation-speed 0))))
(asdf:defsystem :celtk
:name "celtk"
:author "Kenny Tilton <ktilton(a)nyc.rr.com>"
:version "2.0"
:maintainer "Kenny Tilton <ktilton(a)nyc.rr.com>"
:licence "MIT Style"
:description "Tk via LTk with Cells Inside(tm)"
:long-description "A Cells-driven portable GUI built atop the LTk core, ultimately implmented by Tk"
:depends-on (:cells)
:serial t
:components ((:file "ltk-kt")
(:file "Celtk")
(:file "tk-format")
(:file "menu")
(:file "composites")
(:file "textual")
(:file "widgets")
(:file "canvas")
(:file "demos")))
--- /project/cells/cvsroot/Celtk/Celtk.lisp 2006/03/16 05:15:14 NONE
+++ /project/cells/cvsroot/Celtk/Celtk.lisp 2006/03/16 05:15:14 1.1
#|
Celtic / widget.lisp : Foundation classes
Copyright (c) 2004 by Kenneth William Tilton <ktilton(a)nyc.rr.com>
A work derived from Peter Herth's LTk. As a derived work,
usage is governed by LTk's "Lisp LGPL" licensing:
You have the right to distribute and use this software as governed by
the terms of the Lisp Lesser GNU Public License (LLGPL):
(http://opensource.franz.com/preamble.html)
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Lisp Lesser GNU Public License for more details.
|#
(defpackage :celtk
(:nicknames "CTK")
(:use :common-lisp :utils-kt :cells)
(:import-from #:ltk
#:wish-stream #:*wish* #:*ewish* "*DEBUG-TK*"
#:peek-char-no-hang #:read-data
#:send-wish #:tkescape
#:with-ltk #:do-execute #:add-callback)
(:export #:window #:panedwindow #:mk-row #:pack-self #:mk-stack #:mk-text-widget
#:mk-panedwindow
#:mk-stack #:mk-radiobutton #:mk-radiobutton-ex #:mk-radiobutton #:mk-label #:selection #:selector
#:mk-checkbutton #:mk-button #:mk-button-ex #:mk-entry
#:frame-stack #:mk-frame-stack #:pack-layout? #:path
#:mk-menu-entry-radiobutton #:mk-menu-entry-checkbutton
#:mk-menu-radio-group #:mk-menu-entry-separator
#:mk-menu-entry-command #:tk-callback #:mk-menu #:mk-menu-entry-cascade #:mk-menubar
#:^entry-values #:tk-eval-list #:mk-scale #:mk-popup-menubutton
#:mk-polygon #:mk-oval #:mk-line #:mk-arc #:mk-text-item
#:mk-rectangle #:mk-bitmap #:mk-canvas #:mk-frame-row
#:mk-scrolled-list #:listbox-item #:mk-spinbox
#:with-ltk #:tk-format #:send-wish #:value #:.tkw
#:tk-user-queue-handler))
(defpackage :celtk-user
(:use :common-lisp :utils-kt :cells :celtk))
(in-package :Celtk)
(defmodel tk-object (model)
((.md-name :cell nil :initform (gentemp "TK") :initarg :id)
(tk-class :cell nil :initform nil :initarg :tk-class :reader tk-class)))
(defmethod md-awaken :before ((self tk-object))
(make-tk-instance self))
(define-symbol-macro .tkw (nearest self window))
;;; --- widget -----------------------------------------
(defmodel widget (family tk-object)
((path :accessor path :initarg :path
:initform (c? (trc nil "path calc" self (parent-path (fm-parent self)) (md-name self))
(format nil "~(~a.~a~)"
(parent-path (fm-parent self))
(md-name self))))
(layout :reader layout :initarg :layout :initform nil)
(enabled :reader enabled :initarg :enabled :initform t)
(bindings :reader bindings :initarg :bindings :initform nil)
(image-files :reader image-files :initarg :image-files :initform nil)
(selector :reader selector :initarg :selector
:initform (c? (upper self selector))))
(:default-initargs
:id (gentemp "W")))
(defmethod make-tk-instance ((self widget))
(setf (gethash (^path) (dictionary .tkw)) self)
(when (tk-class self)
(tk-format `(:make-tk ,self) "~(~a~) ~a ~{~(~a~) ~a~^ ~}"
(tk-class self) (path self)(tk-configurations self)) :stdfctry))
;;;(defmethod md-awaken :before ((self widget))
;;; (loop for (name file-pathname) in (^image-files)
;;; do (tk-format "image create photo ~(~a.~a~) -file ~a"
;;; (^path) name (tkescape (namestring file-pathname)))))
(defobserver image-files ()
;
; I do not know how to create the photo for X before X exists
; though it seems to work. <g> perhaps Tk understands it does not need to
; place the image in a tree and lets the undefined path go? If so,
; just add :pre-make-kt before :make-kt in the sort list
;
(loop for (name file-pathname) in (set-difference new-value old-value :key 'car)
do (tk-format `(:pre-make-tk ,self) "image create photo ~(~a.~a~) -file ~a"
(^path) name (tkescape (namestring file-pathname)))))
(defobserver bindings () ;;; (w widget) event fun)
(loop for (event fmt fn) in new-value
for name = (gentemp "BNDG")
do (tk-format `(:bind ,self) "bind ~a ~a ~a" ;; {puts {:callback ~a}}"
(^path) event (format nil fmt (register-callback self name fn)))))
(defobserver layout ((self widget))
(when new-value
(assert (null (kids-layout .parent)) ()
"Do not specify layout (here for ~a) unless parent leaves kids-layout unspecified.
This parent is ~a, kids-layout ~a" self (list .parent (type-of .parent)) (kids-layout .parent)))
;
; This use next of the parent instead of self is pretty tricky. It has to do with getting
; the pack commands out nested widgets before parents. The pack command issued on behalf
; of a top frame is sorted on the parent. Now we have to pack the top frame. If we associate
; the command with the frame, the sort is a tie and either might go first. So we continue
; the theme and associate /this/ pack with this top frame's parent. Note that we cannot go the
; normal route and pack the kids in their own context, because multiple kids get packed
; in one pack statement (and we cannot arbitrarily pack with the first kid because this is a nested
; deal and any kid might have kids, so each family packs associated with itself)
;
(when (and new-value (not (typep .parent 'panedwindow)))
(tk-format `(:pack ,(fm-parent self)) new-value)))
(defun pack-self ()
(c? (format nil "pack ~a" (path self))))
(defmethod tk-configure ((self widget) option value)
(tk-format `(:configure ,self ,option) "~A configure ~(~a~) ~a" (path self) option (tk-send-value value)))
(defmethod not-to-be :after ((self widget))
(trc nil "not-to-be tk-forgetting true widget" self)
(tk-format `(:forget ,self) "pack forget ~a" (^path))
(tk-format `(:destroy ,self) "destroy ~a" (^path)))
;;; --- items -----------------------------------------------------------------------
(defmodel item (tk-object)
((id-no :cell nil :initarg :id-no :accessor id-no :initform nil)
(coords :initarg :coords :initform nil))
(:documentation "not full blown widgets, but decorations thereof")
(:default-initargs
:id (gentemp "I")))
(defmethod make-tk-instance ((self item))
(when (tk-class self)
(with-integrity (:client `(:make-tk ,self))
(tk-format :grouped "senddata [~a create ~a ~{ ~a~} ~{~(~a~) ~a~^ ~}]"
(path .parent) (down$ (tk-class self)) (coords self) (tk-configurations self))
(setf (id-no self) (read-data)))))
(defmethod tk-configure ((self item) option value)
(assert (id-no self) () "cannot configure item ~a until instantiated and id obtained" self)
(tk-format `(:itemconfigure ,self ,option)
"~A itemconfigure ~a ~a {~a}" (path .parent) (id-no self) (down$ option) value))
(defobserver coords ()
(when (and (id-no self) new-value)
(tk-format `(:coords ,self)
"~a coords ~a ~{ ~a~}" (path .parent) (id-no self) new-value)))
(defmethod not-to-be :after ((self item))
(trc nil "whacking item" self)
(tk-format `(:delete ,self) "~a delete ~a" (path (upper self widget)) (id-no self)))
(defparameter *tk-changers* nil)
;;; --- deftk --------------------
(defmacro deftk (class superclasses
(&rest std-slots)
&rest defclass-options)
(destructuring-bind (&optional tk-class &rest tk-options)
(cdr (find :tk-spec defclass-options :key 'car))
(setf tk-options (tk-options-normalize tk-options))
(multiple-value-bind (slots outputs)
(loop for (slot-name tk-option) in tk-options
collecting `(,slot-name :initform nil
:initarg ,(intern (string slot-name) :keyword)
:accessor ,slot-name)
into slot-defs
when tk-option
collecting `(defobserver ,slot-name ((self ,class))
(when (and new-value old-value-boundp)
(tk-configure self ,(string tk-option) new-value)))
into outputs
finally (return (values slot-defs outputs)))
`(progn
(defmodel ,class ,(or superclasses '(widget))
(,@(append std-slots slots))
,@(remove-if (lambda (k) (find k '(:default-initargs :tk-spec))) defclass-options :key 'car)
(:default-initargs
,@(when tk-class `(:tk-class ',tk-class))
,@(cdr (find :default-initargs defclass-options :key 'car))))
(defmethod tk-class-options append ((self ,class))
',tk-options)
(defmacro ,(intern (conc$ "MK-" (symbol-name class))) (&rest inits)
`(make-instance ',',class
:fm-parent *parent*
,@inits))
,@outputs))))
(defun tk-options-normalize (tk-options)
"normalize '(-aaa (tk-bbb -bbb)) => '((aaa -aaa)(tk-bbb -bbb))"
(loop for tk-option-def in tk-options
for slot-name = (intern (de- (if (atom tk-option-def)
tk-option-def (car tk-option-def))))
collecting (list slot-name (if (atom tk-option-def)
tk-option-def (cadr tk-option-def)))))
(eval-when (compile load eval)
(defun de- (sym)
(remove #\- (symbol-name sym) :end 1)))
(defgeneric tk-class-options (self)
(:method-combination append))
(defun tk-configurations (self)
(loop for (slot-name tk-option) in (remove-duplicates (tk-class-options self) :key 'second)
for slot-value = (funcall slot-name self) ;; must go thru accessor with Cells, cannot (slot-value self slot-name)
when (and tk-option slot-value)
nconcing (list tk-option (tk-send-value slot-value))))
; --- callbacks ----------------------------------------------------
(defun tk-callback (self id-suffix fn &optional command)
(declare (ignorable command))
(let ((id (register-callback self id-suffix fn)))
(trc nil "tk-callback" self id command)
(list 'callback id)))
(defun tk-callbackstring (self id-suffix tk-token fn)
(format nil "callbackstring ~s ~a; return 1;"
(register-callback self id-suffix fn)
(string tk-token)))
(defun tk-callbackstring-x (self id-suffix tk-token fn)
(format nil "callbackstring ~s ~a"
(register-callback self id-suffix fn)
(string tk-token)))
(defun tk-callbackval (self id-suffix fn &optional command)
(declare (ignorable command))
(format nil (or command "callbackval ~s")
(register-callback self id-suffix fn)))
(defun register-callback (self callback-id fun)
(assert callback-id)
(let ((id (format nil "~a.~a" (path-index self) callback-id)))
;; (trc "registering callback" self :id (type-of id) id)
(add-callback id fun)
id))
(defmethod path-index (self) (^path))
(defun tk-eval-var (var)
(tk-format :grouped "senddatastring [set ~a]" var)
(read-data))
(defun tk-eval-list (self form$)
(declare (ignore self))
(tk-format :grouped "senddatastrings [~a]" form$)
(read-data))
;--- selector ---------------------------------------------------
(defmodel selector () ;; mixin
((selection :initform nil :accessor selection :initarg :selection)
(tk-variable :initform nil :accessor tk-variable :initarg :tk-variable
:documentation "The TK node name to set as the selection changes (not the TK -variable option)"))
(:default-initargs
:selection (c-in nil)
:tk-variable (c? (^path))))
(defobserver selection ()
;
; handling varies on this, so we hand off to standard GF lest the PROGN
; method combo on slot-listener cause multiple handling
;
(tk-output-selection self new-value old-value old-value-boundp))
[9 lines skipped]
--- /project/cells/cvsroot/Celtk/canvas.lisp 2006/03/16 05:15:15 NONE
+++ /project/cells/cvsroot/Celtk/canvas.lisp 2006/03/16 05:15:15 1.1
[215 lines skipped]
--- /project/cells/cvsroot/Celtk/composites.lisp 2006/03/16 05:15:15 NONE
+++ /project/cells/cvsroot/Celtk/composites.lisp 2006/03/16 05:15:15 1.1
[385 lines skipped]
--- /project/cells/cvsroot/Celtk/demos.lisp 2006/03/16 05:15:15 NONE
+++ /project/cells/cvsroot/Celtk/demos.lisp 2006/03/16 05:15:15 1.1
[723 lines skipped]
--- /project/cells/cvsroot/Celtk/kt69.gif 2006/03/16 05:15:15 NONE
+++ /project/cells/cvsroot/Celtk/kt69.gif 2006/03/16 05:15:15 1.1
[1066 lines skipped]
--- /project/cells/cvsroot/Celtk/load.lisp 2006/03/16 05:15:15 NONE
+++ /project/cells/cvsroot/Celtk/load.lisp 2006/03/16 05:15:15 1.1
[1082 lines skipped]
--- /project/cells/cvsroot/Celtk/ltk-kt.lisp 2006/03/16 05:15:15 NONE
+++ /project/cells/cvsroot/Celtk/ltk-kt.lisp 2006/03/16 05:15:15 1.1
[4453 lines skipped]
--- /project/cells/cvsroot/Celtk/menu.lisp 2006/03/16 05:15:15 NONE
+++ /project/cells/cvsroot/Celtk/menu.lisp 2006/03/16 05:15:15 1.1
[4715 lines skipped]
--- /project/cells/cvsroot/Celtk/textual.lisp 2006/03/16 05:15:15 NONE
+++ /project/cells/cvsroot/Celtk/textual.lisp 2006/03/16 05:15:15 1.1
[4834 lines skipped]
--- /project/cells/cvsroot/Celtk/tk-format.lisp 2006/03/16 05:15:15 NONE
+++ /project/cells/cvsroot/Celtk/tk-format.lisp 2006/03/16 05:15:15 1.1
[4956 lines skipped]
--- /project/cells/cvsroot/Celtk/widgets.lisp 2006/03/16 05:15:15 NONE
+++ /project/cells/cvsroot/Celtk/widgets.lisp 2006/03/16 05:15:15 1.1
[5206 lines skipped]
1
0
Update of /project/cells/cvsroot/Celtk
In directory clnet:/tmp/cvs-serv21247
Log Message:
Status:
Vendor Tag: tcvs-vendor
Release Tags: tcvs-release
No conflicts created by this import
1
0