I'm ok with this workaround that uses only one name.  Though I'm sure others 
have stared at code wondering why it won't load as a result of a comment not 
being allowed on a line.  This last point has more to do with the motivation 
than not being able to write something.  There doesn't seem to be a good reason 
to not allow end of "statement" comments.

NB. first part of multipart definition (comment outside of function)
v =. 3 : 0 
 +: y 
) 
NB. second part of multipart definition (comment outside of function. 
NB. Can include more comments too)
v =. 4 : 0 (v f.)
 x+ y 
)
  2 v 3 
8



----- Original Message -----
From: Joe Bogner <[email protected]>
To: [email protected]
Cc: 
Sent: Thursday, June 4, 2015 8:53 PM
Subject: Re: [Jprogramming] would changing multiline parsing of ) and : be good 
ideas?

On Thu, Jun 4, 2015 at 8:13 PM, 'Pascal Jasmin' via Programming <
[email protected]> wrote:

> 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.
>
> [snip]


> 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
> )
>
>
> Can you elaborate on this use case? Are you using codegen to write this
code or are you hand writing it? I'd like to understand it more to see if
there's an alternate, more readable and equally flexible way to accomplish
it



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