develooper Front page | perl.perl6.users | Postings from July 2021

Re: REPL / Linenoise question (backslashes)

Thread Previous | Thread Next
From:
rir
Date:
July 18, 2021 01:46
Subject:
Re: REPL / Linenoise question (backslashes)
Message ID:
20210718014627.42g4t4lxven7pwhy@localhost
On Wed, Jul 14, 2021 at 08:40:07AM -0700, William Michels via perl6-users wrote:

> > \
> {}
> > \\
> {}
> > \\\
> {}

> Curiously, I seem to create an object in my REPL environment when I enter
> either a single-, double-, or triple-backslash.   ...

Your backslash destroys the newline so the input is non-existent.  The
empty hash seems an implementation artifact; a place to capture
the type and value of the code.  Perhaps issuing a prompt as if a bare newline
was typed would be better.

Witness:

> my $x = 1 + 3 \
{}
> my $x = ( 1 + 3 \ )
4
> \ # comment
Nil
> ;
Nil

Rob

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About