Le samedi 24 septembre 2016 18:46:07 UTC+2, William G Hatch a écrit :
> Udelim is a library for adding extra parens and string delimiters to
> your language.
I can't tell how ecstatic I am about this :) . I have been wanting to add new
parenthesis shapes for a while, but never found the time to look seriously into
it, so thank you a lot for writing this! I was thinking about using the white
brackets ⟦⟧, braces ⦃⦄ and parentheses ⦅⦆ are commonly used for describing
semantics, for example.
I also like the idea of nestable string delimiters, although I rarely have use
for it.
One note about the docs: when you write:
(open-input-string
"«this is a string with nested «string delimiters.» No \n escape
interpreting.»")
the "\n" is already escaped by the "…" fed into open-input-string I think, so
what udelim parses in that example is a raw newline, not the \ character
followed by the n character.
Scribble supports "element transformers" which allow to change how an
identifier is printed. Unfortunately, when the identifier appears in the first
position of a form (like the #% wrappers), only the identifier itself can get
styled, not the whole form. I added a few days ago a quick hack to my unstable
scribble-enhanced library to add catch-alls which can re-style any identifier
matching a given pattern. The hack [1] should also work for whole forms
(untested, though), so that in scribble or scribble/lp2, @racketblock[(a ⟦b⟧
c)] would be properly typeset.
Georges
[1] The hack in scribble-enhanced
https://github.com/jsmaniac/scribble-enhanced/blob/master/racket.rkt#L1012
[2] Example using the hack to nicely typeset identifiers with numeric
superscripts like String³, which means "three strings in a row" for the xlist
type expander
https://github.com/jsmaniac/xlist/blob/master/scribble-enhanced.rkt
--
You received this message because you are subscribed to the Google Groups
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.