[Openmcl-devel] Simple Agent-based Engine 0.2

Bill St. Clair wws at clozure.com
Sat May 30 07:33:15 PDT 2009


[resend for the list]

On Sat, May 30, 2009 at 10:19 AM, Raffael Cavallaro
<raffaelcavallaro at mac.com> wrote:
>
> On May 30, 2009, at 10:06 AM, Bill St. Clair wrote:
>
>> You could use cl-who:
>>
>> CL-USER> (setq cl-who:*html-empty-tag-aware-p* nil)
>> NIL
>> CL-USER> (cl-who:with-html-output-to-string (s nil :indent t)
>>            (:chatty-window
>>              :track-mouse "true" :title "Objects" :margin "0"
>>              (:agent-3d-view
>>                :name "scene"
>>                (:cube :texture "crate.png")
>>                  (:sphere :x "2.0")
>>                  (:sphere :x "3.0" :texture "earth.png")
>>                  (:cube :size "3.0" :z "-3.5" :texture "crate.png")
>>                  (:cube :x "5" :roll "45.0")
>>                  (:sky-dome :pitch "90"))))
>> "
>> <chatty-window track-mouse='true' title='Objects' margin='0'>
>>  <agent-3d-view name='scene'>
>>    <cube texture='crate.png' />
>>    <sphere x='2.0' />
>>    <sphere x='3.0' texture='earth.png' />
>>    <cube size='3.0' z='-3.5' texture='crate.png' />
>>    <cube x='5' roll='45.0' />
>>    <sky-dome pitch='90' />
>>  </agent-3d-view>
>> </chatty-window>"
>
> Nice. Is there a way to avoid quoting the non-string parameters
> (numbers and booleans?)?

Attribute parameters get evaluated and PRINC'd, so you don't need the
quotes around the numbers:

CL-USER: (cl-who:with-html-output-to-string  (s nil :indent t)
           (:agent-3d-view
            :name "scene"
            (:cube :texture "crate.png")
            (:sphere :x 2.0)
            (:sphere :x 3.0 :texture "earth.png")
            (:cube :size 3.0 :z -3.5 :texture "crate.png")
            (:cube :x 5 :roll 45.0)
            (:sky-dome :pitch 90)))
"
<chatty-window track-mouse='true' title='Objects' margin='0'>
  <agent-3d-view name='scene'>
    <cube texture='crate.png' />
    <sphere x='2.0' />
    <sphere x='3.0' texture='earth.png' />
    <cube size='3.0' z='-3.5' texture='crate.png' />
    <cube x='5' roll='45.0' />
    <sky-dome pitch='90' />
  </agent-3d-view>
</chatty-window>"



More information about the Openmcl-devel mailing list