Re: [Factor-talk] CHAR: question

2016-02-22 Thread John Benediktsson
CHAR: space 

Is also

CHAR: \s



> On Feb 22, 2016, at 6:40 AM, Alexander Ilin  wrote:
> 
> Hello!
> 
>  Thanks, John!
> 
>  You did not answer where the list of names comes from within Factor, but at 
> least I can google for the names I need, knowing they are in the Unicode 
> standard. Here's the resulting piece of code I've been working on:
> 
> : filter-text ( text-length -- string )
>read
>{ CHAR: \r } { CHAR: \n } replace
>[
>{
>{ CHAR: \t [ t ] }
>{ CHAR: \n [ t ] }
>[ CHAR: space >= ]
>} case
>] filter >string ;
> 
>  Looks nice to me.
> 
>  Thanks again for your help. 
> 
> 22.02.2016, 17:23, "John Benediktsson" :
>> CHAR: works with all named Unicode code points. In the listener use tab 
>> completion to see, for example:
>> 
>> CHAR: ex
>> 
>> Where  is press the tab key for tab completion.
>> 
>>>  On Feb 22, 2016, at 6:07 AM, Alexander Ilin  wrote:
>>> 
>>>  Hello, Jon!
>>> 
>>>   Thank you for the reply!
>>> 
>>>   I've looked through the documentation you suggested, and that's exactly 
>>> what I need.
>>> 
>>>   I have a follow-up question regarding CHAR:. In the documentation there 
>>> is a line in the Examples section:
>>> 
>>>   CHAR: exclamation-mark
>>> 
>>>   It works. However I can't seem to find the definition of the 
>>> exclamation-mark word. I made a search in file contents, and it seems to 
>>> only exist in the core\syntax\syntax-docs.factor, and in the factor.image 
>>> files.
>>> 
>>>   Where does it come from? Because I'd like to see the full list of words 
>>> available for use with CHAR:.
>>> 
>>>   Thanks.
>>> 
>>>  22.02.2016, 16:52, "Jon Harper" :
  Hi,
 
  The exact answer would be
  http://docs.factorcode.org/content/article-literals.html , for
  example:
  CONSTANT: CR-char-code 13
  CONSTANT: LF-char-code 10
  { 13 13 10 10 } ${ CR-char-code } ${ LF-char-code } replace
 
  However, in this case you can also use the "CHAR:" parsing word
  { 13 13 10 10 } { CHAR: \r } { CHAR: \n } replace
 
  regards,
  Jon
  Jon
 
>  On Mon, Feb 22, 2016 at 2:25 PM, Alexander Ilin  wrote:
>   Hello!
> 
> The following code works the way I want it to:
> 
>   { 13 13 10 10 } { 13 } { 10 } replace
>   -> { 10 10 10 10 }
> 
> But when I tried to use named constants, it no longer works:
> 
>   CONSTANT: CR-char-code 13
>   CONSTANT: LF-char-code 10
>   { 13 13 10 10 } { CR-char-code } { LF-char-code } replace
>   -> { 13 13 10 10 }
> 
> I realized, that probably the issue is that by constructing sequences 
> with { } I somehow didn't give the words a chance to push their values 
> instead of themselves.
> 
> What would be the correct way to use named constants for such a use 
> case?
> 
>   ---=---
>Александр
> 
>   
> --
>   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
>   ___
>   Factor-talk mailing list
>   Factor-talk@lists.sourceforge.net
>   https://lists.sourceforge.net/lists/listinfo/factor-talk
 
  
 --
  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
  ___
  Factor-talk mailing list
  Factor-talk@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/factor-talk
>>> 
>>>  ---=---
>>>  Александр
>>> 
>>>  
>>> --
>>>  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
>>>  ___
>>>  Factor-talk mailing list
>>>  Factor-talk@lists.sourceforge.net
>>>  https://lists.sourceforge.net/lists/listinfo/factor-talk
>> 
>> 

Re: [Factor-talk] CHAR: question

2016-02-22 Thread Alexander Ilin
22.02.2016, 17:40, "Jon Harper" :
> You can see from the definition that is uses the name>char-hook, which
> then uses the name>char word to lookup names, which in the end reads
> and caches the basis/unicode/data/UnicodeData.txt file.

  Great! That explains why searching for "exclamation-mark" failed to yield 
solid results.
  Thank you for the info!

---=---
 Александр

--
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
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] CHAR: question

2016-02-22 Thread Alexander Ilin
Hello!

  Thanks, John!

  You did not answer where the list of names comes from within Factor, but at 
least I can google for the names I need, knowing they are in the Unicode 
standard. Here's the resulting piece of code I've been working on:

: filter-text ( text-length -- string )
read
{ CHAR: \r } { CHAR: \n } replace
[
{
{ CHAR: \t [ t ] }
{ CHAR: \n [ t ] }
[ CHAR: space >= ]
} case
] filter >string ;

  Looks nice to me.

  Thanks again for your help. 

22.02.2016, 17:23, "John Benediktsson" :
> CHAR: works with all named Unicode code points. In the listener use tab 
> completion to see, for example:
>
> CHAR: ex
>
> Where  is press the tab key for tab completion.
>
>>  On Feb 22, 2016, at 6:07 AM, Alexander Ilin  wrote:
>>
>>  Hello, Jon!
>>
>>   Thank you for the reply!
>>
>>   I've looked through the documentation you suggested, and that's exactly 
>> what I need.
>>
>>   I have a follow-up question regarding CHAR:. In the documentation there is 
>> a line in the Examples section:
>>
>>   CHAR: exclamation-mark
>>
>>   It works. However I can't seem to find the definition of the 
>> exclamation-mark word. I made a search in file contents, and it seems to 
>> only exist in the core\syntax\syntax-docs.factor, and in the factor.image 
>> files.
>>
>>   Where does it come from? Because I'd like to see the full list of words 
>> available for use with CHAR:.
>>
>>   Thanks.
>>
>>  22.02.2016, 16:52, "Jon Harper" :
>>>  Hi,
>>>
>>>  The exact answer would be
>>>  http://docs.factorcode.org/content/article-literals.html , for
>>>  example:
>>>  CONSTANT: CR-char-code 13
>>>  CONSTANT: LF-char-code 10
>>>  { 13 13 10 10 } ${ CR-char-code } ${ LF-char-code } replace
>>>
>>>  However, in this case you can also use the "CHAR:" parsing word
>>>  { 13 13 10 10 } { CHAR: \r } { CHAR: \n } replace
>>>
>>>  regards,
>>>  Jon
>>>  Jon
>>>
  On Mon, Feb 22, 2016 at 2:25 PM, Alexander Ilin  wrote:
   Hello!

 The following code works the way I want it to:

   { 13 13 10 10 } { 13 } { 10 } replace
   -> { 10 10 10 10 }

 But when I tried to use named constants, it no longer works:

   CONSTANT: CR-char-code 13
   CONSTANT: LF-char-code 10
   { 13 13 10 10 } { CR-char-code } { LF-char-code } replace
   -> { 13 13 10 10 }

 I realized, that probably the issue is that by constructing sequences 
 with { } I somehow didn't give the words a chance to push their values 
 instead of themselves.

 What would be the correct way to use named constants for such a use 
 case?

   ---=---
    Александр

   
 --
   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
   ___
   Factor-talk mailing list
   Factor-talk@lists.sourceforge.net
   https://lists.sourceforge.net/lists/listinfo/factor-talk
>>>
>>>  
>>> --
>>>  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
>>>  ___
>>>  Factor-talk mailing list
>>>  Factor-talk@lists.sourceforge.net
>>>  https://lists.sourceforge.net/lists/listinfo/factor-talk
>>
>>  ---=---
>>  Александр
>>
>>  
>> --
>>  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
>>  ___
>>  Factor-talk mailing list
>>  Factor-talk@lists.sourceforge.net
>>  https://lists.sourceforge.net/lists/listinfo/factor-talk
>
> --
> 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

Re: [Factor-talk] CHAR: question

2016-02-22 Thread Jon Harper
You can see from the definition that is uses the name>char-hook, which
then uses the name>char word to lookup names, which in the end reads
and caches the basis/unicode/data/UnicodeData.txt file.
Jon


On Mon, Feb 22, 2016 at 3:22 PM, John Benediktsson  wrote:
> CHAR: works with all named Unicode code points.  In the listener use tab 
> completion to see, for example:
>
> CHAR: ex
>
> Where  is press the tab key for tab completion.
>
>
>
>> On Feb 22, 2016, at 6:07 AM, Alexander Ilin  wrote:
>>
>> Hello, Jon!
>>
>>  Thank you for the reply!
>>
>>  I've looked through the documentation you suggested, and that's exactly 
>> what I need.
>>
>>  I have a follow-up question regarding CHAR:. In the documentation there is 
>> a line in the Examples section:
>>
>>  CHAR: exclamation-mark
>>
>>  It works. However I can't seem to find the definition of the 
>> exclamation-mark word. I made a search in file contents, and it seems to 
>> only exist in the core\syntax\syntax-docs.factor, and in the factor.image 
>> files.
>>
>>  Where does it come from? Because I'd like to see the full list of words 
>> available for use with CHAR:.
>>
>>  Thanks.
>>
>> 22.02.2016, 16:52, "Jon Harper" :
>>> Hi,
>>>
>>> The exact answer would be
>>> http://docs.factorcode.org/content/article-literals.html , for
>>> example:
>>> CONSTANT: CR-char-code 13
>>> CONSTANT: LF-char-code 10
>>> { 13 13 10 10 } ${ CR-char-code } ${ LF-char-code } replace
>>>
>>> However, in this case you can also use the "CHAR:" parsing word
>>> { 13 13 10 10 } { CHAR: \r } { CHAR: \n } replace
>>>
>>> regards,
>>> Jon
>>> Jon
>>>
 On Mon, Feb 22, 2016 at 2:25 PM, Alexander Ilin  wrote:
  Hello!

The following code works the way I want it to:

  { 13 13 10 10 } { 13 } { 10 } replace
  -> { 10 10 10 10 }

But when I tried to use named constants, it no longer works:

  CONSTANT: CR-char-code 13
  CONSTANT: LF-char-code 10
  { 13 13 10 10 } { CR-char-code } { LF-char-code } replace
  -> { 13 13 10 10 }

I realized, that probably the issue is that by constructing sequences 
 with { } I somehow didn't give the words a chance to push their values 
 instead of themselves.

What would be the correct way to use named constants for such a use 
 case?

  ---=---
   Александр

  
 --
  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
  ___
  Factor-talk mailing list
  Factor-talk@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/factor-talk
>>>
>>> --
>>> 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
>>> ___
>>> Factor-talk mailing list
>>> Factor-talk@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/factor-talk
>>
>> ---=---
>> Александр
>>
>> --
>> 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
>> ___
>> Factor-talk mailing list
>> Factor-talk@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/factor-talk
>
> --
> 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
> ___
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk

--
Site24x7 APM Insight: Get Deep Visibility 

Re: [Factor-talk] CHAR: question

2016-02-22 Thread John Benediktsson
CHAR: works with all named Unicode code points.  In the listener use tab 
completion to see, for example:

CHAR: ex

Where  is press the tab key for tab completion. 



> On Feb 22, 2016, at 6:07 AM, Alexander Ilin  wrote:
> 
> Hello, Jon!
> 
>  Thank you for the reply!
> 
>  I've looked through the documentation you suggested, and that's exactly what 
> I need.
> 
>  I have a follow-up question regarding CHAR:. In the documentation there is a 
> line in the Examples section:
> 
>  CHAR: exclamation-mark
> 
>  It works. However I can't seem to find the definition of the 
> exclamation-mark word. I made a search in file contents, and it seems to only 
> exist in the core\syntax\syntax-docs.factor, and in the factor.image files.
> 
>  Where does it come from? Because I'd like to see the full list of words 
> available for use with CHAR:.
> 
>  Thanks.
> 
> 22.02.2016, 16:52, "Jon Harper" :
>> Hi,
>> 
>> The exact answer would be
>> http://docs.factorcode.org/content/article-literals.html , for
>> example:
>> CONSTANT: CR-char-code 13
>> CONSTANT: LF-char-code 10
>> { 13 13 10 10 } ${ CR-char-code } ${ LF-char-code } replace
>> 
>> However, in this case you can also use the "CHAR:" parsing word
>> { 13 13 10 10 } { CHAR: \r } { CHAR: \n } replace
>> 
>> regards,
>> Jon
>> Jon
>> 
>>> On Mon, Feb 22, 2016 at 2:25 PM, Alexander Ilin  wrote:
>>>  Hello!
>>> 
>>>The following code works the way I want it to:
>>> 
>>>  { 13 13 10 10 } { 13 } { 10 } replace
>>>  -> { 10 10 10 10 }
>>> 
>>>But when I tried to use named constants, it no longer works:
>>> 
>>>  CONSTANT: CR-char-code 13
>>>  CONSTANT: LF-char-code 10
>>>  { 13 13 10 10 } { CR-char-code } { LF-char-code } replace
>>>  -> { 13 13 10 10 }
>>> 
>>>I realized, that probably the issue is that by constructing sequences 
>>> with { } I somehow didn't give the words a chance to push their values 
>>> instead of themselves.
>>> 
>>>What would be the correct way to use named constants for such a use case?
>>> 
>>>  ---=---
>>>   Александр
>>> 
>>>  
>>> --
>>>  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
>>>  ___
>>>  Factor-talk mailing list
>>>  Factor-talk@lists.sourceforge.net
>>>  https://lists.sourceforge.net/lists/listinfo/factor-talk
>> 
>> --
>> 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
>> ___
>> Factor-talk mailing list
>> Factor-talk@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/factor-talk
> 
> ---=---
> Александр
> 
> --
> 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
> ___
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk

--
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
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] CHAR: question

2016-02-22 Thread Alexander Ilin
Hello, Jon!

  Thank you for the reply!

  I've looked through the documentation you suggested, and that's exactly what 
I need.

  I have a follow-up question regarding CHAR:. In the documentation there is a 
line in the Examples section:

  CHAR: exclamation-mark

  It works. However I can't seem to find the definition of the exclamation-mark 
word. I made a search in file contents, and it seems to only exist in the 
core\syntax\syntax-docs.factor, and in the factor.image files.

  Where does it come from? Because I'd like to see the full list of words 
available for use with CHAR:.

  Thanks.

22.02.2016, 16:52, "Jon Harper" :
> Hi,
>
> The exact answer would be
> http://docs.factorcode.org/content/article-literals.html , for
> example:
> CONSTANT: CR-char-code 13
> CONSTANT: LF-char-code 10
> { 13 13 10 10 } ${ CR-char-code } ${ LF-char-code } replace
>
> However, in this case you can also use the "CHAR:" parsing word
> { 13 13 10 10 } { CHAR: \r } { CHAR: \n } replace
>
> regards,
> Jon
> Jon
>
> On Mon, Feb 22, 2016 at 2:25 PM, Alexander Ilin  wrote:
>>  Hello!
>>
>>    The following code works the way I want it to:
>>
>>  { 13 13 10 10 } { 13 } { 10 } replace
>>  -> { 10 10 10 10 }
>>
>>    But when I tried to use named constants, it no longer works:
>>
>>  CONSTANT: CR-char-code 13
>>  CONSTANT: LF-char-code 10
>>  { 13 13 10 10 } { CR-char-code } { LF-char-code } replace
>>  -> { 13 13 10 10 }
>>
>>    I realized, that probably the issue is that by constructing sequences 
>> with { } I somehow didn't give the words a chance to push their values 
>> instead of themselves.
>>
>>    What would be the correct way to use named constants for such a use case?
>>
>>  ---=---
>>   Александр
>>
>>  
>> --
>>  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
>>  ___
>>  Factor-talk mailing list
>>  Factor-talk@lists.sourceforge.net
>>  https://lists.sourceforge.net/lists/listinfo/factor-talk
>
> --
> 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
> ___
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk

---=---
 Александр

--
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
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk