Re: [Unicon-group] Succeed() useless? UTR18 Unicon, Snobol

2016-02-14 Thread Michael Meehan
Man,  you are truly one righteous hard core dude out there still slinging the 
Snobol. Thanks to all the great computer scientists who are keeping this 
tradition alive. For my modest contribution, I am working with a graduate 
student to put an #IFDEF together to use the SIMD instructions on the Intel AVX 
capable processors to implement arbitrary precision integers, hopefully 8x 
faster than the "copy it straight from Knuth implementation." It has,of course, 
 occurred to us that string comparisons (which is what this language MUST excel 
at  (particularly the "on the eventual abstract machine" multi-byte ones) would 
benefit from the SIMD instructions.  I applaud the great work you have 
continued and will let you know when we have a minor (sub-build) branch that 
will make the "largeint" stuff work faster by using the SIMD instructions. 

Michael Meehan
mee...@wwu.edu for work-related items only
jmichaelmee...@gmail.com for non-work-related items only


From: Jay Hammond 
Sent: Sunday, February 14, 2016 4:14 PM
To: unicon-group@lists.sourceforge.net; sno...@yahoogroups.com
Subject: [Unicon-group] Succeed() useless? UTR18 Unicon, Snobol

I too am interested in Snobol patterns in Unicon. I still use Snobol
more than Unicon, 'cos that's where the easy string scanning is.

I found something quite surprising (flamebait even).

Pattern Matching in Unicon
Clinton Jeffery, Sudarshan Gaikaiwari and John Goettsche
Unicon Technical Report: 1
February 9, 2016


Here's a url for the technical reports

http://unicon.sourceforge.net/reports.html

& this is UTR18

http://unicon.org/utr/utr18.pdf

and here's a quote.  I thought someone might like to tell me why
I am wrong to dispute the following statement on page number 16, the
17th of 23

"4.4.8 Succeed(): Match Always

This pattern was added to Unicon to match SNOBOL4 pattern for pattern.
The authors do not know of any meaningful use of Succeed()."

When I started programming, I did not see a need for no-op. In
assembler, Forth and genetics, there are useful side effects to no-op.

I know a practical use for Succeed() or its equivalents.
Do you have any more?


Snobol assigns a pattern to the variable SUCCEED, and that value is
&SUCCEED which also exists. It does not have Succeed() the function.


In Snobol,
Succeed always successfully matches the null string.
likewise Succeed() in Unicon .

If I assign that null string to a variable,  I can recognise that
succeed matched null.
If succeed is the last alternative of several that pattern-match, then,
in context,
Succeed() represents the pattern that recognises that the desired
pattern is
absent.


< one><2><3><5>
<2><3><5>



and that's useful for erasing unwanted data (by assignment), and
recognising gap in paradigm patterns. (There is an example lower down)


Icon, unlike Snobol4, has &null. UTR18 speaks of patterns like Pos()
matching the empty string. The Green book (The Snobol4 Programming
language 2nd ed. Griswold Poage & Polonsky) says the empty string and
the the null value are the same.

Using the uninitialised value of null instead of Succeed() is poor
practice, because in general one should not rely on the value
(if any) of uninitialised variables.

But looking hard at the Green book, I can always use the null string or
'' or "" to represent &null in Snobol. I can replace Succeed ( or
Succeed() ) by a pattern matching null (including but not limited to:
testing for the current cursor position, and matching the null string)
in both Icon & Snobol.

As far as I know, I can strictly replace Succeed() with  a pattern
valued &null because a successful function that has no return value,
returns null. Or is there something about transmission I have ignored
that I should not have?

So there are equivalents to Succeed() we can use.  And the use is, as I
said, for matching the gap in the paradigm.  It's possible to avoid the
use of the expression "Succeed()"  but the construction (in some form)
is necessary.

That's perhaps too abstract? I give a less abstract example.  It
corresponds fairly closely, I now discover, to the pattern match on
pages 35-36, section 2.6  of the Green book.  So you may not need to
read it at all.

Jay

Example_start

My data matches 5 patterns 1,2,3,4,5   .This is the fat version.
or maybe just 3 patterns 1,3,5  I call that variant degenerate or skinny.

Imagine a sort of census data perhaps in CSV format,  where if
respondent was ever married, they must also state the  number of
children,  and the number of divorces.

I'm analysing columns of data. the data in the columns is of variable
width so I pattern match the data. I am faced with two sorts of rows,
full fat ones, and skinny ones. Full fat rows have 5 columns, skinny
(degenerate) ones just 3.

To put all the data in a structure prior to processing, I read the data
row by row, and assign the columns to the appropriate variable.

snn = span('0123456789')
   p1 = ("£" snn ("." (snn | Succee

Re: [Unicon-group] Succeed() useless? UTR18 Unicon, Snobol

2016-02-14 Thread Michael Meehan
Man,  you are truly one righteous hard core dude out there still slinging the 
Snobol. Thanks to all the great computer scientists who are keeping this 
tradition alive. For my modest contribution, I am working with a graduate 
student to put an #IFDEF together to use the SIMD instructions on the Intel AVX 
capable processors to implement arbitrary precision integers, hopefully 8x 
faster than the "copy it straight from Knuth implementation." It has,of course, 
 occurred to us that string comparisons (which is what this language MUST excel 
at  (particularly the "on the eventual abstract machine" multi-byte ones) would 
benefit from the SIMD instructions.  I applaud the great work you have 
continued and will let you know when we have a minor (sub-build) branch that 
will make the "largeint" stuff work faster by using the SIMD instructions.

Michael Meehan
mee...@wwu.edu for work-related items only
jmichaelmee...@gmail.com for non-work-related items only

Michael Meehan
mee...@wwu.edu for work-related items only
jmichaelmee...@gmail.com for non-work-related items only


From: Jay Hammond 
Sent: Sunday, February 14, 2016 4:14 PM
To: unicon-group@lists.sourceforge.net; sno...@yahoogroups.com
Subject: [Unicon-group] Succeed() useless? UTR18 Unicon, Snobol

I too am interested in Snobol patterns in Unicon. I still use Snobol
more than Unicon, 'cos that's where the easy string scanning is.

I found something quite surprising (flamebait even).

Pattern Matching in Unicon
Clinton Jeffery, Sudarshan Gaikaiwari and John Goettsche
Unicon Technical Report: 1
February 9, 2016


Here's a url for the technical reports

http://unicon.sourceforge.net/reports.html

& this is UTR18

http://unicon.org/utr/utr18.pdf

and here's a quote.  I thought someone might like to tell me why
I am wrong to dispute the following statement on page number 16, the
17th of 23

"4.4.8 Succeed(): Match Always

This pattern was added to Unicon to match SNOBOL4 pattern for pattern.
The authors do not know of any meaningful use of Succeed()."

When I started programming, I did not see a need for no-op. In
assembler, Forth and genetics, there are useful side effects to no-op.

I know a practical use for Succeed() or its equivalents.
Do you have any more?


Snobol assigns a pattern to the variable SUCCEED, and that value is
&SUCCEED which also exists. It does not have Succeed() the function.


In Snobol,
Succeed always successfully matches the null string.
likewise Succeed() in Unicon .

If I assign that null string to a variable,  I can recognise that
succeed matched null.
If succeed is the last alternative of several that pattern-match, then,
in context,
Succeed() represents the pattern that recognises that the desired
pattern is
absent.


< one><2><3><5>
<2><3><5>



and that's useful for erasing unwanted data (by assignment), and
recognising gap in paradigm patterns. (There is an example lower down)


Icon, unlike Snobol4, has &null. UTR18 speaks of patterns like Pos()
matching the empty string. The Green book (The Snobol4 Programming
language 2nd ed. Griswold Poage & Polonsky) says the empty string and
the the null value are the same.

Using the uninitialised value of null instead of Succeed() is poor
practice, because in general one should not rely on the value
(if any) of uninitialised variables.

But looking hard at the Green book, I can always use the null string or
'' or "" to represent &null in Snobol. I can replace Succeed ( or
Succeed() ) by a pattern matching null (including but not limited to:
testing for the current cursor position, and matching the null string)
in both Icon & Snobol.

As far as I know, I can strictly replace Succeed() with  a pattern
valued &null because a successful function that has no return value,
returns null. Or is there something about transmission I have ignored
that I should not have?

So there are equivalents to Succeed() we can use.  And the use is, as I
said, for matching the gap in the paradigm.  It's possible to avoid the
use of the expression "Succeed()"  but the construction (in some form)
is necessary.

That's perhaps too abstract? I give a less abstract example.  It
corresponds fairly closely, I now discover, to the pattern match on
pages 35-36, section 2.6  of the Green book.  So you may not need to
read it at all.

Jay

Example_start

My data matches 5 patterns 1,2,3,4,5   .This is the fat version.
or maybe just 3 patterns 1,3,5  I call that variant degenerate or skinny.

Imagine a sort of census data perhaps in CSV format,  where if
respondent was ever married, they must also state the  number of
children,  and the number of divorces.

I'm analysing columns of data. the data in the columns is of variable
width so I pattern match the data. I am faced with two sorts of rows,
full fat ones, and skinny ones. Full fat rows have 5 columns, skinny
(degenerate) ones just 3.

To put all the data in a structure prior to processing, I read the data
row by row, an

[Unicon-group] Succeed() useless? UTR18 Unicon, Snobol

2016-02-14 Thread Jay Hammond
I too am interested in Snobol patterns in Unicon. I still use Snobol
more than Unicon, 'cos that's where the easy string scanning is.

I found something quite surprising (flamebait even).

Pattern Matching in Unicon
Clinton Jeffery, Sudarshan Gaikaiwari and John Goettsche
Unicon Technical Report: 1
February 9, 2016


Here's a url for the technical reports

http://unicon.sourceforge.net/reports.html

& this is UTR18

http://unicon.org/utr/utr18.pdf

and here's a quote.  I thought someone might like to tell me why
I am wrong to dispute the following statement on page number 16, the 
17th of 23

"4.4.8 Succeed(): Match Always

This pattern was added to Unicon to match SNOBOL4 pattern for pattern.
The authors do not know of any meaningful use of Succeed()."

When I started programming, I did not see a need for no-op. In
assembler, Forth and genetics, there are useful side effects to no-op.

I know a practical use for Succeed() or its equivalents.
Do you have any more?


Snobol assigns a pattern to the variable SUCCEED, and that value is
&SUCCEED which also exists. It does not have Succeed() the function.


In Snobol,
Succeed always successfully matches the null string.
likewise Succeed() in Unicon .

If I assign that null string to a variable,  I can recognise that 
succeed matched null.
If succeed is the last alternative of several that pattern-match, then, 
in context,
Succeed() represents the pattern that recognises that the desired 
pattern is
absent.


< one><2><3><5>
<2><3><5>



and that's useful for erasing unwanted data (by assignment), and
recognising gap in paradigm patterns. (There is an example lower down)


Icon, unlike Snobol4, has &null. UTR18 speaks of patterns like Pos()
matching the empty string. The Green book (The Snobol4 Programming
language 2nd ed. Griswold Poage & Polonsky) says the empty string and
the the null value are the same.

Using the uninitialised value of null instead of Succeed() is poor
practice, because in general one should not rely on the value
(if any) of uninitialised variables.

But looking hard at the Green book, I can always use the null string or
'' or "" to represent &null in Snobol. I can replace Succeed ( or
Succeed() ) by a pattern matching null (including but not limited to:
testing for the current cursor position, and matching the null string)
in both Icon & Snobol.

As far as I know, I can strictly replace Succeed() with  a pattern
valued &null because a successful function that has no return value,
returns null. Or is there something about transmission I have ignored
that I should not have?

So there are equivalents to Succeed() we can use.  And the use is, as I
said, for matching the gap in the paradigm.  It's possible to avoid the
use of the expression "Succeed()"  but the construction (in some form)
is necessary.

That's perhaps too abstract? I give a less abstract example.  It
corresponds fairly closely, I now discover, to the pattern match on
pages 35-36, section 2.6  of the Green book.  So you may not need to 
read it at all.

Jay

Example_start

My data matches 5 patterns 1,2,3,4,5   .This is the fat version.
or maybe just 3 patterns 1,3,5  I call that variant degenerate or skinny.

Imagine a sort of census data perhaps in CSV format,  where if
respondent was ever married, they must also state the  number of
children,  and the number of divorces.

I'm analysing columns of data. the data in the columns is of variable
width so I pattern match the data. I am faced with two sorts of rows,
full fat ones, and skinny ones. Full fat rows have 5 columns, skinny
(degenerate) ones just 3.

To put all the data in a structure prior to processing, I read the data
row by row, and assign the columns to the appropriate variable.

snn = span('0123456789')
   p1 = ("£" snn ("." (snn | Succeed) | Succeed)) . colOneData

* p1 matches column 1, p2 matches column 2 etc
* each pattern assigns what it matches to its column.
  fullfat = p1 p2 p3 p4 p5
  skinny = p2 p3 p5

  row  fullfat  | skinny :s(report_and_iterate)f(fixup)

  ok, I iterate for a few rows, and after a fat row, I get a skinny row.
  colOneData and colfourData still contain the data for the fat row.

  colTwoData  colThreeData and colFiveData contain skinny data. As a
  programmer I must somehow recognise that the skinny row had no data in
  columns 1 and 4. I can represent no data as the null value in the
  corresponding variable.

  How to do that? I can
  ++ pre-test each row,
  ++ set a flag when I match a  skinny row, & test the flag when reporting,
  then  run a function that erases  colOneData and colfourData
 just in time
  ++ run the same function at the end of a successful  skinny match,

   there are lots of (inelegant) ways.

To only overwrite the fat data when in a successful skinny match, I
conditionally assign the null string to the variables corresponding to
the absent columns.  I match null for columns 1 and 4 in the skinny
match.
I alter the subpatterns  of fullfat and sk

Re: [Unicon-group] Regex additions to Unicon - answering my own question

2016-02-14 Thread Bruce & Breeanna Rennie
Doing a bit of looking around, I find that I have, in fact, asked this 
same question in September last year. And Clinton responded as well.

I must be getting a little old in the tooth not to have remembered this 
(as we say here, having a senior moment - not funny as I am getting to 
that time of life). I should have looked in my own archive of messages 
first, before writing.

So, even though there is no documents on the subject as yet, I'll still 
try to see what I can determine and do the changes to my original 
program and then give some feedback.

regards

Bruce Rennie

On 14/02/16 16:19, Bruce & Breeanna Rennie wrote:
> Good afternoon Clinton,
>
> I have a simple question for you. When did the regex facilities get into
> the Unicon compiler? I am currently reading up on the Pattern Matching
> facilities and the document UTR18.pdf mentions them. I have local
> versions from the end of June last year and the end of September last
> year. The facilities appear in the sources I have for September.
>
> I can't recall any notification that these facilities were being
> incorporated. Did I miss some announcement?
>
> I have a small program using the regex library which I am now updating
> to patterns, but I will be interested in testing the regex facilities in
> the current Unicon compiler.
>
> regards
>
> Bruce Rennie
>
> --
> Site24x7 APM Insight: Get Deep Visibility into Application Performance
> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
> Monitor end-to-end web transactions and take corrective actions now
> Troubleshoot faster and improve end-user experience. Signup Now!
> http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
> ___
> Unicon-group mailing list
> Unicon-group@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/unicon-group
>


--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
___
Unicon-group mailing list
Unicon-group@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/unicon-group