Robert Kawulak | 21 May 02:29

[quickbook] Several template bugs & Turing-completeness

Hi,

I've found several bugs regarding templates in Quickbook from 1.35 release:

1. This does not work:

[template sitelink[page name] [@http://site.org/[page] [name]]]
[sitelink index.html here] <- "error: Expanding template"

2. This causes access violation (memory write):

[template join1[a b] [b][a]] <- "error: Expanding template"
[template join2[a b] [a][b]]
[template test[x] [join1 [join2 0 [x]] 0]]
[test 0]

3. It would be nice if this worked:

[template t1 foo]
[template t2[t] [[t]]]
[t2 t1] <- "error: Expanding template"

4. Sometimes, when a matching ']' is missing, Quickbook hangs with 100% CPU
usage. However, I don't have any code snippet causing this right now.

BTW, in the docs there is a statement that Quickbook is Turing-complete. This
made me curious, but I haven't figured out yet how this works. Could somebody
send an example of some simple algorithm executed using Quickbook? Thanks in
advance. ;-)

(Continue reading)

Joel de Guzman | 21 May 08:21

Re: [quickbook] Several template bugs & Turing-completeness

Robert Kawulak wrote:
> Hi,

Hi! Please write a trac ticket for this so it won't go
unnoticed, ok? Anyway...

> I've found several bugs regarding templates in Quickbook from 1.35 release:
> 
> 1. This does not work:
> 
> [template sitelink[page name] [@http://site.org/[page] [name]]]
> [sitelink index.html here] <- "error: Expanding template"

Yeah. It's unfortunate that some old markups do not
expand templates in some parts. The @ markup in particular
does not allow expansions in the url part. This should be
solved as soon as we rewrite them as templates. For example,
this works:

[template ulink[url name] '''<ulink url="'''[url]'''">'''[name]'''</ulink>''']
[template sitelink[page name] [ulink '''http://site.org/'''[page] [name]]]
[sitelink index.html here]

(Be careful with the slashes! They are regarded as italics)

> 2. This causes access violation (memory write):
> 
> [template join1[a b] [b][a]] <- "error: Expanding template"
> [template join2[a b] [a][b]]
> [template test[x] [join1 [join2 0 [x]] 0]]
(Continue reading)


Gmane