I'm not sure that works, Bill

The main use case for nested multiline expressions is documents such as html 
where each multiline group has its own parser.  So the style tag includes 
highly structured easily parsable info, that is different from most tags.  A 
3rd group could contain J expressions that are templated into the body.

You don't care about keeping names for each individual group, but as Chris 
mentioned, its hard to read, and so placing a comment on each closing 
parentheses makes it much easier to... such as:


v =. (4 : 0) (3 : 0) 
 +: y 
) NB. outer monad ^
 x+y 
) NB. inner dyad ^


or as described for the main use case:

htmltext =: htmlwrapper (styleparser 0 : 0) , bodypareser 0 : 0
 bodytext
) NB. formatted style tag (tab separated)  Name    prop    value 
 styleinput
)


----- Original Message -----
From: bill lam <[email protected]>
To: Programming forum <[email protected]>
Cc: 
Sent: Thursday, June 4, 2015 7:11 PM
Subject: Re: [Jprogramming] would changing multiline parsing of ) and : be good 
ideas?

IMO nested explicit definition such as the following would be more readable

v =. 4 : 0
u =. 3 : 0
+: y
)
x+u y
)
  2 v 3
8
On Jun 5, 2015 1:42 AM, "'Pascal Jasmin' via Programming" <
[email protected]> wrote:

> its possible to define nested multiple line expressions such as:
>
> v =. (4 : 0) (3 : 0)
> +: y
> )
> x+y
> )
>   2 v 3
> 8
>
>  A problem is that you cannot place even a comment on the same line as a
> closing ')'
>
> It would seem to be a simple modification to the parser to check for the
> first character of a line to be ')' or ':', and the parser already takes
> out any trailing blanks, so a simple useful change might be to strip out
> trailing comments (first) and (then) blanks.
>
> This would have the added benefit of including documentation that is not
> inserted into the function, which commenting what part of an expression ')'
> is closing should not be anyway.
>
> Any arguments against this change?
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm

>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to