Hello everybody,

I'm announcing another little package I've written to get comments on
it:  udelim.

Udelim is a library for adding extra parens and string delimiters to
your language.

For many years, before ever coming to racket, I've wanted nestable
string delimiters.  Especially when working with web stuff.  Now that I
have a programmable programming language, I have them.  The big push to
making them now is that lately with rash I've been working on nesting
different syntax with macros and alternative readers.  Some weeks ago I
found myself dissatisfied with the method I was using (at-expressions),
and wrote the code for balanced strings instead, and have loved it.

Additionally, I've long wanted more types of parens in Racket.  I
haven't really known what I would do with them -- I use Racket's
conventions for () and [], and have my own loose convention for {}.  But
after seeing Jay McCarthy's wonderful talk on Remix, I am now blatantly
stealing his idea of wrapping different paren types with a
macro-dispatchable symbol.

So udelim has functions for extending readtables to have more parens and
balanced string delimiters, optionally wrapped up a-la Remix.  It also
has a stx-string->port function for convenience in making macros that
read an alternate syntax with those nestable strings.  It has a
metalanguage with some delimiters auto-enabled:  «» (guillemets, used as
quotes in many European languages) as nestable, non-escaping quotes, 「」
likewise but wrapped so 「foo bar」 reads as (#%cjk-corner-quotes "foo
bar"), and several unicode paren types (﴾﴿, ⦓⦔, ⦕⦖, 🌜🌛, ...) wrapped
with a starter symbol as well.

Some people I've talked to about this package have seemed unhappy with
my introduction of nestable strings, and my recommendation of using them
over the at-expressions for nesting different syntax, so I feel I ought
to explain that a little.  First, nestable strings are nice for other
things as well.  For instance, since they don't escape backslashes, they
are nice for constructing regexps, which famously explode into mountains
of backslashes due to being inside "" strings.  They are a great
alternative to #<<HERE strings when you want something big and
complicated for any purpose.  Second, while I love the at-reader for
Scribble, I think it has several drawbacks for nesting different syntax.

• It splits up the string at newlines.  Not a huge deal -- you can
reassemble them, but it's a bit of a hassle.

• It expands inner @-exps unless you use |{}|.  Again, not a huge deal
as long as you sprinkle in some pipes.

• It removes leading white space on every line.  This is a bad thing if
your nested language is whitespace sensitive, like a python or
haskell-style syntax would be.  By reading the location data on the
strings you get back, you can probably still reconstruct the original
string, but it's still a hassle.

• After all the at-exp's work splitting and trimming the string, every
macro that uses at-exp output as if it were just a string has to do all
the work of putting it all back together into a string to use as a port.
If you just get a string in the first place, none of that is necessary,
and the macro's interface is simpler.

So I love the at-reader, I just like nestable strings better for this
purpose, and I want nestable strings even without syntax nesting.  No
hard feelings.  If you still think these nestable strings are a bad
idea, I'd like to hear your reasoning.

I'd love some feedback on what paren types should be included in #lang
udelim (I'm not sure what is widely supported by fonts, sufficiently
distinct, and well liked), and what default macros on them should do.

Also, I've upgraded rash significantly with it, and rewrote the docs on
it so my intentions are a little more clear.  It hasn't progressed too
much, as I'm otherwise busy with things I'm actually supposed to be
working on, but if you're curious to see a slightly better presentation
of what I want #lang rash to be, you can take a gander.

Additionally, could someone clue me in to where a good explanation of
language-info stuff is?  The languages I've implemented all have
language info lifted off something else, and it's definitely wrong.  But
all I've found in my (meager) search for what to do there is that
*something* is supposed to be there, and that it will probably fix my
languages' issues in DrRacket.  Or maybe I'm totally misunderstanding
it.  Otherwise my languages work fine, so I haven't bothered too much to
correct it, but I would like to...  I'm sure the info I need is in the
docs somewhere, but the reference can be rather expansive for reading
unless you know the right search term.


Thanks for your feedback,

William

[ PS, udelim docs are here: http://docs.racket-lang.org/udelim/index.html ]

--
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.

Reply via email to