felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Derek Baum (JIRA)" <j...@apache.org>
Subject [jira] Commented: (FELIX-1487) Support for commands on multiple lines
Date Tue, 25 Aug 2009 00:48:59 GMT

    [ https://issues.apache.org/jira/browse/FELIX-1487?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12747163#action_12747163

Derek Baum commented on FELIX-1487:

yes, my approach would cause the result of:

echo aa
echo ab | grep a

to be:


This problem will be solved if we swap the priorities of | and ;

{ ; should be ignored as a null command, but currently it is not:

% each [1 2 3] {; echo $it}
IllegalArgumentException: Command not found:  *:;

However, extra ; cannot be inserted in arrays:

% each [; a; b;] { echo $it}

I agree that we should try to avoid \, but this simple approach works surprising well - much
better than having to add ; to each line.

Of course it would be nice if newline was a distinct token, then the parser could treat newline
as whitespace or statement-separator, depending on context.

> Support for commands on multiple lines
> --------------------------------------
>                 Key: FELIX-1487
>                 URL: https://issues.apache.org/jira/browse/FELIX-1487
>             Project: Felix
>          Issue Type: Improvement
>          Components: Gogo
>            Reporter: Guillaume Nodet
> I think this is important, especially when writing closures, to be able to split commands
on multiple lines.
> From the shell, it can't be easily leveraged, unless the command line edition also supports
multiline edition, but for script files, it would be really handy.
> My original thinking would be to consider new lines as ';', but this may required changing
the precedence order of | and ;
> The other solution would be add a pseudo grouping operator () on each line in addition
to considering newlines as ';'

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message