Larry Wall wrote:
Dealing with antediluvian displays sounds like a good spot for that
ancient technology, the preprocessor,

: I also figured that this would be a fairly simple thing to do.

Well, it will be simple, once we have macros; in fact, textual macros
can be regarded simply as scoped preprocessors, with all the rights,
privileges, and responsibilities pertaining thereto.  I think macros
will provide enough language support for this sort of "hard things
should be possible" escape hatch.  And remember you can always override
the grammar if you have special reasons for doing so.  That's what
Perl 6 is all about.  It's not about foreseeing every possible twinge
of misgiving that anyone may come to feel in the next 100 years...

Sure, we're trying to create a gigantic sweet spot in Perl 6, but
Willy Wonka knows you can't have the whole world, and if you could,
you can't have it now.  :)

FYI,

As a follow-up, this Perl 6 discussion has inspired me to apply some of these ideas to my Muldis D language (PTMD_STD dialect), so then there should be an earlier example of the concept I proposed.

The feature that I went and specced out today, and named "unspace" after its Perl 6 inspiration, basically is a token consisting of a pair of backslashes separated by whitespace. Currently this token can be placed in the middle of either a numeric or a stringy literal (including quoted formats of identifiers), and in the latter case *inside* the quotes.

Examples:

  $bar := 7;55084\ \4222\ \7677  # an integer expressed in octal #

  $some_pi := 3.141592653589793238462643383279\
    \5028841971693993751058209749445923078164\
    \0628620899862803482534211706798214808651\
    \3282306647093844609550582231725359408128

  $a_rat := 48111745028410270193\
    \8521105559 / 64462294895493038196\
    \442881097566593344612847564823

  $a_string := 'hello this world\
    \ how are you today'

  $a_string := 'hello this world'
    ~ ' how are you today'

Those, except the last, are direct translations of the pseudo-Perl-6 I gave earlier in the thread.

Note that since Muldis D's use of backslashes differs in some ways from how Perl 6 uses them (backslashes are only otherwise used for spelling escaped characters), the above syntax doesn't conflict with anything there.

One detail unlike Perl 6's unspace is that I put a backslash at both ends of the stuff to ignore, so when used for the above purpose the code isn't end-weighted and a human can parse what's going on faster. Also, my version of unspace is simpler in that you don't put any comments in it.

Now if naming my concept "unspace" may confuse people, as it is partially like that of Perl 6 but partly not, I could name it something else, but that name seemed the best for now, because it is all about letting a programmer put some whitespace in their code which the parser would then treat as if it wasn't there at all.

-- Darren Duncan

Reply via email to