Re: Improvements to gnuapl

2021-02-23 Thread Elias Mårtenson
Perhaps this library can help: https://github.com/google/gumbo-parser It should be reasonably easy to call it from GNU APL. Den tis 23 feb. 2021 20:09Blake McBride skrev: > If I were parsing HTML, I would have an exception list that contained the > few tags that don't have closing tags. I woul

Re: Improvements to gnuapl

2021-02-23 Thread Blake McBride
If I were parsing HTML, I would have an exception list that contained the few tags that don't have closing tags. I wouldn't expect a closing tag for those. If I did get one, I'd ignore it. There is a very small and fixed number of these exceptional tags. Custom tags should have closing tags. -

Re: Improvements to gnuapl

2021-02-23 Thread Dr . Jürgen Sauermann
Hi Blake, You're correct. Another problem in HTML is unquoted attribute values in HTML tags. I should have said "One can use ⎕XML for decoding HTML pages and the like as long as they obey the fundamental XML encoding rules". I believe it would be possible to make ⎕XML tolerate some of these

Re: Improvements to gnuapl

2021-02-23 Thread Christian Robert
All thoses request are based on the following piece of code i saw in 2004 (in nars2000): ⎕cr '#BoxFMT' Z←Z #BoxFMT R;RD;LD;D LD←⍕(0≠⍴⍴R)/¯1↑⍴R RD←⍕⍪¯1↓⍴R RD←(+/RD=' ')⌽RD D←¯2+⍴⍴Z :if D>0 :while 2<⍴⍴Z Z←,[¯3 ¯2] Z,[¯2]' ' :endwhile Z←(-D)↓[0]Z :endif Z←(¯2↑1,⍴Z)⍴Z ⋄ Z←((⍴Z)⌈(¯1↑⍴RD),⍴LD)

Re: Improvements to gnuapl

2021-02-23 Thread Elias Mårtenson
Actually, when I said experiment I meant experiment with language design, not using such features. With KAP I decided to depart from standard APL on a few areas so that some new interesting behaviour could be of implemented. A lot of of standard APL works though. Of course, if you are looking for

Re: Improvements to gnuapl

2021-02-23 Thread Christian Robert
NARS2000-64 has already this kind of syntax while exactly having the core of gnuapl/apl2 for maybe 10 years. if you want to experiment download it (windows only and free) http://www.nars2000.org/download/Download.html Xtian. in feb 2015 i asked: that said, my re

Re: Improvements to gnuapl

2021-02-23 Thread Elias Mårtenson
If you you want to experiment with this stuff, my project needs help. 😃 Den tis 23 feb. 2021 18:07Christian Robert skrev: > I will ask again in 6 years. > > Xtian. > > On 2021-02-22 14:36, Dr. Jürgen Sauermann wrote: > > Hi Christian, > > > > I can't quite follow the argument that :IF/:ELSE etc.

Re: Improvements to gnuapl

2021-02-23 Thread Christian Robert
I will ask again in 6 years. Xtian. On 2021-02-22 14:36, Dr. Jürgen Sauermann wrote: Hi Christian, I can't quite follow the argument that :IF/:ELSE etc. makes it easier for newcomers to learn APL. If I remember my learning of APL some decades ago correctly, then, coming straight from ALGOL and

Re: Improvements to gnuapl

2021-02-22 Thread Blake McBride
Some of those "optional" end tags are not optional at all. It's not HTML if it's there. For example: is not HTML. --blake On Mon, Feb 22, 2021 at 1:21 PM Dr. Jürgen Sauermann < mail@jürgen-sauermann.de> wrote: > Hi, > > as far as I understand it, HTML has almost the same format as XML (

Re: Improvements to gnuapl

2021-02-22 Thread Dr . Jürgen Sauermann
Hi Christian, I can't quite follow the argument that :IF/:ELSE etc. makes it easier for newcomers to learn APL. If I remember my learning of APL some decades ago correctly, then, coming straight from ALGOL and BASIC as my first "high-level

Re: Improvements to gnuapl

2021-02-22 Thread Dr . Jürgen Sauermann
Hi, as far as I understand it, HTML has almost the same format as XML (the main difference being optional end tags in HTML which are mandatory in XML. I would assume that ⎕XML can do the decoding of common web interfaces like the REST API or other XML

Re: Improvements to gnuapl

2021-02-22 Thread Elias Mårtenson
This could be quite useful when collecting data from a web site. For example, pull in a table of numbers from a Wikipedia page. Google Docs has this feature already and it can be quite useful. Regards, Elias On Mon, 22 Feb 2021 at 22:26, Chris Moller wrote: > Sounds like another native function

Re: Improvements to gnuapl

2021-02-22 Thread Chris Moller
Sounds like another native function!  :-) Maybe after I finish my current project... On 2/22/21 5:26 AM, Hans-Peter Sorge wrote: Hi, I would modify the data model and/or process graph or use an adequate programming language. In my opinion, having to rely on data content to control program flo

Re: Improvements to gnuapl

2021-02-21 Thread Blake McBride
Just my two cents. I've never had a problem with what Chris is saying. In fact, I think adding if/else as described earlier would make APL not APL. If you want if/else as described earlier, just write your own apl'ish language. (I wrote my first APL 41 years ago.) Blake On Sun, Feb 21, 2021

Re: Improvements to gnuapl

2021-02-21 Thread Chris Moller
What's wrong with good old-fashioned computed-goto like:   1 testit y   2 v←hello first second byebye   3 →(y=⍳⍴v)/v   4 hello: 'hello'   5 →byebye   6 first: 'first'   7 →byebye   8 second: 'second'   9 byebye: 'byebye' variations of which work fine as if/then/else, case statements, and while/

Re: Improvements to gnuapl

2021-02-20 Thread Elias Mårtenson
In principle I agree with you. There are many occasions where an IF statement in particular is useful, or even necessary. However, implementing it in GNU APL would take careful consideration, and I know Jürgen wants to make sure any new extensions doesn't contradict the principles of what APL is.