Samuel Wales | 4 Jan 21:33

extensible syntax

A general idea, which might or might not be useful.

There are occasionally questions about syntax, like this:

  Also, I'm afraid definition matching regexp won't play
  nicely with text indentation, ... -- Paul

Or this:

  What would be safer?  -- Carsten

I like the footnote implementation, so this is for future
features, not necessarily footnotes.

One issue when implementing new syntax (or changing existing
syntax or cleaning up code) is parsing risk, which I will
define as the risk that the syntax and the regexp or
matching code:

  1) conflicts with user text
  2) conflicts with existing features
  3) will be hard to maintain
  4) constrains future features by making them conflict
     syntactically
  5) makes you run out of syntax to use in the future
  6) will require complicated regexps
  7) doesn't readily handle stuff you might want in the
     future, like being combined with another feature
  8) will be hard to quote, escape, comment, *boldify*, etc.
  9) doesn't handle nestability, print-readability,
(Continue reading)

Samuel Wales | 5 Jan 17:19

Re: extensible syntax

Hello again :),

Let me provide examples -- using footnotes.

All footnote references and definitions would be inside
$[...].  (As mentioned in my previous post.)

There was a concern about keeping code executable.  You can
use a parameter to specify whether you want the footnote to:

  - disappear in the code (thus keeping the code executable
    without having to use comments, so that the reference is
    at the correct position in the line, yet keeping the
    link pointing to the correct position)
  - or show up as a numbered or labeled reference

The reference can look like:

  (defun my-example-defun $[fn "defun name" :invisible t] ()
    (interactive "P") ;$[fn "interactive"]
    ...

The second reference is visible, but the first is not.  Note
that this allows references with spaces (or anything else).
No need to worry about syntax conflicts within org.

There was also a concern about conflicting with code syntax.
Your decision as a user is whether you want $[...] to be
interpreted as code or footnote.  You could want either one.

(Continue reading)

Carsten Dominik | 6 Jan 11:08
Favicon

Re: Re: extensible syntax


On Jan 5, 2009, at 5:19 PM, Samuel Wales wrote:

> Hello again :),
>
> Let me provide examples -- using footnotes.
>
> All footnote references and definitions would be inside
> $[...].  (As mentioned in my previous post.)
>
> There was a concern about keeping code executable.  You can
> use a parameter to specify whether you want the footnote to:
>
>  - disappear in the code (thus keeping the code executable
>    without having to use comments, so that the reference is
>    at the correct position in the line, yet keeping the
>    link pointing to the correct position)
>  - or show up as a numbered or labeled reference
>
> The reference can look like:
>
>  (defun my-example-defun $[fn "defun name" :invisible t] ()
>    (interactive "P") ;$[fn "interactive"]
>    ...
>
> The second reference is visible, but the first is not.  Note
> that this allows references with spaces (or anything else).
> No need to worry about syntax conflicts within org.
>
> There was also a concern about conflicting with code syntax.
(Continue reading)


Gmane