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:

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?

# Thanks and...

-- (site pro) (liens, favoris)

Attachment: apply_segfaults.l
Description: Binary data

Attachment: xml.l
Description: Binary data

Reply via email to