Dear list,
I'm writing an .svg file from Picolisp.
For this, I'm using the xml lib Jon once started to write, a small lib
that was enhanced by others:
https://www.mail-archive.com/picolisp@software-lab.de/msg00510.html

Here is the content of my demo file:

(load "lib/xml.l")

# I have this next line working correctly:
(<xml> text text-anchor "middle" font-size 24 x 120 y 100 (prin "hello"))

# It prints:
# <text text-anchor="middle" font-size="24" x="120" y="100">hello</text>

# Since I have many such lines, I wanted to factor out some common attributes:
(setq text_conf '(text text-anchor "middle" font-size 24))

# In order to call <xml> with the default args and then the particular args,
# decided to use apply:
(apply <xml> (quote text text-anchor "middle" font-size 24 x 120 y 99
(prin "hello")))

# But it *sometimes* segfaults, and *sometimes* print:
# < ="middle" ="24" ="120" ="99" =""/>

# So what's wrong with my use of apply?
# Would it be interesting to give an example in the docs with symbols instead
# of numbers?
# http://www.software-lab.de/doc/refA.html#apply

# Thanks and...
(bye)


-- 

http://profgra.org/lycee/ (site pro)
http://delicious.com/profgraorg (liens, favoris)
https://twitter.com/profgraorg

Attachment: apply_segfaults.l
Description: Binary data

Attachment: xml.l
Description: Binary data

Reply via email to