Changes between Initial Version and Version 1 of BoostDocs/Quickbook-1.5


Ignore:
Timestamp:
May 29, 2009, 7:40:57 PM (13 years ago)
Author:
Daniel James
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • BoostDocs/Quickbook-1.5

    v1 v1  
     1= Quickbok 1.5 =
     2
     3== Dynamic Scoping vs. Static Scoping ==
     4
     5{{{
     6}}}
     7
     8quickbook currently uses dynamic scoping which is generally
     9accepted to be a bad idea. So I'd like to change it to use static
     10scoping.
     11
     12{{{
     13   [template x static scoping]
     14   [template foo1[] [x]]
     15   [template foo2[x] [foo1]]
     16   [foo2 dynamic scoping]
     17}}}
     18
     19Will currently return 'dynamic scoping', I'd like it to change it to
     20return 'static scoping' for 1.5 or whatever.
     21
     22== Template Lookup Location ==
     23
     24#2034
     25
     26When template arguments are expanded they are evaluated with the
     27current scope rather than the scope they were called with which can be
     28surprising. So I'd like to change it so that they are bound to the
     29correct scope.
     30
     31{{{
     32  [template x new]
     33  [template foo1[a x] [a]]
     34  [foo1 [x] old]
     35}}}
     36
     37Will return 'old' at the moment, I'd prefer it to return 'new'.
     38Another way to achieve this would be to evaluate template arguments
     39eagerly but that would be a much bigger change and harder to implement
     40a version switch for.
     41
     42== Simplified Template Arg Handling ==
     43
     44#1174
     45
     46David Abrahams wrote:
     47> IMO the rules that allow you to do things like leave out a nullary
     48> template's argument list when the template body doesn't look like an
     49> argument list
     50
     51Joel:
     52> This can be removed. I agree.
     53
     54David:
     55> and combining simple argument separators with ".."
     56> separators are confusing at best and don't provide real utility.  I
     57> think we should avoid such syntax quirks.
     58
     59Joel:
     60> Those are there to provide backward compatibility. One of the goals
     61> is to replace/rewrite most of the rules using templates. Alas, QB's
     62> syntax is admittedly quirky to begin with. In an ideal world, I'd
     63> redesign the syntax set and rewrite Qb, but, I guess I don't quite
     64> have time to invest on such a rewrite.
     65
     66David:
     67> I also have no problem with
     68{{{
     69[stuff a..b..c..d]
     70}}}
     71> I do have a problem with
     72{{{
     73[stuff a..b c d]
     74}}}
     75> unless that's just 2 arguments.
     76
     77Joel:
     78> Alright, so you want it either to be the first form, or the
     79> second form, but not combined. Noted.
     80
     81== Spaces in template arguments ==
     82
     83#2036
     84
     85{{{
     86[template join1[a b] [b][a]] [/<- "error: Expanding template"]
     87[template join2[a b] [a][b]]
     88[template test[x] [join1 [join2 0 [x]] 0]]
     89[test 0]
     90}}}
     91
     92The problem here is that join1 is interpreting spaces as argument seperators. So this line:
     93{{{
     94[template test[x] [join1 [join2 0 [x]] 0]]
     95}}}
     96is interpreted as:
     97{{{
     98[template test[x] [join1 [join2..0 [x]] 0]]
     99}}}
     100Which is confusing, it probably should be interpreted as:
     101{{{
     102[template test[x] [join1 [join2 0 [x]]..0]]
     103}}}
     104
     105I think that both seperators (spaces and `..`) should be ignored inside square brackets.