Subject: Re: Merry CoSy Christmas 2020
From: Bob Armstrong <bob@cosy.com>
Date: 2021-01-06, 15:33
To: andrew warren <treeandysann@yahoo.com>
CC: Remy Clarke <clarke.remy@gmail.com>, Don Golding <donaldrgolding@gmail.com>

Thanks , Andy .

I've been digging into the Reva Forth to really understand it enough to lock up exceptions .  I think maybe I should start daily or at least weekly updates of the scripts in http://cosy.com/4thCoSy/Code/CoSy/ .

| 1324 | Just decided to go ahead and did it .
While uploading individual files is clearly a bad idea because some changes are dependent across scripts , updating the whole set modified more recently than those you have should at least not be worse .

On 2021-01-06 05:17, andrew warren wrote:
Also HP calculators for RPN notation.
Ah , the HP-35 . Life changing .

I was viewing your video on Y-Mas trees and that isn't working on mine. I F6 the first line and CoSy locks up, I get a spinning circle that never recovers.
Took me a bit to find that code at http://cosy.com/4thCoSy/Code/CoSy/y2019.txt , Tue.Dec,20191217 .

Yep , it hangs . Let's split it apart
Ah , I see the problem . ' _take needs to be replaced with ' take . I changed the main each verbs to consistently use  ' at working on CoSy  lists rather than  ' i@ which returns naked integers .

So the lines need to be
 https://www.facebook.com/groups/PROGRAMMINGFORTH/permalink/2265087163791305/

| Y-mas Tree
 "bl ` / 16 _iota ' take 'R  1 _cut { cL -16 _fill } 'R
 R0  ` \ 16 _iota ' take 'R 1 _cut { "bl cL 16 _fill } 'm  ' cL 'd >t0>
|  R0 R0 reverse ' cL 'd .. ' cL 'd
 t0 ` o#o s"  # " ,L   i( 14 4 14 )i { & at } 'L  cL  >t0>
(
                /\              
               //\\             
              ///\\\            
             ////\\\\           
            /////\\\\\          
           //////\\\\\\         
          ///////\\\\\\\        
         ////////\\\\\\\\       
        /////////\\\\\\\\\      
       //////////\\\\\\\\\\     
      ///////////\\\\\\\\\\\    
     ////////////\\\\\\\\\\\\   
    /////////////\\\\\\\\\\\\\  
   //////////////\\\\\\\\\\\\\\ 
  ///////////////\\\\\\\\\\\\\\\
 oooooooooooooo####oooooooooooooo
               ####             
 )
| t0 flip  { ,/ reverse } 'm     | X-mas tree

Also did 2 other things, changed my browser via ` BROWSER ->
Excellent !  You must be getting a feeling for how uniquely transparent the structure of CoSy  is .   

And saw how you did a vector calc 

f( 2579 3869 )f ' %f ./ | 0.6665805
| as opposed to doing non-vector wise
 
2579. 3869. f/ _f   | 0.6665805 same result
(my sigdig is set to 7)
Reva parses number with a decimal point as floats and puts them directly on the hardware floating point stack . f/ is the naked Forth floating divide which operates on the float stake .  _f takes the top of the float stack and returns it as a 1 item CoSy float list .
You could also write
 2579. _f 3869. _f %f
or
 2579. 3869. 2_f %f 
lifting the raw floats to 1 item lists and applying the CoSy level float divide .

| --
I'll finish by mentioning an email exchange earlier with SV-FIG about the original name of FORTH being all uppercase because that's all the hardware had at the time .  Here's what I wrote :

Never heard the term before . But quick DDG shows most of the programming world nose .

I like camelToes , oops , camelCase  . Use it lots . I see of the
 ` ALPHabet Dv@ >t0>
 ec Words >t1> #     |>| 933
words in the CoSy vocabulary 
 t1  t1 t0 26 _take  { ' memb 'R ,/ ' maxi ./ } 'L ,/ & at >t1> #  |>| 249
 t1  t1 t0 26 _cut  { ' memb 'R ,/ ' maxi ./ } 'L ,/  & at >t1> #  |>| 174

174 are humped .

Thanks again . Now back to sufficiently  grokking Reva's exception handling to tame it .

Bob A

| --

On Tuesday, January 5, 2021, 11:38:01 AM EST, andrew warren <treeandysann@yahoo.com> wrote:


Bob I played with FORTH decades ago. I have used PostScript which is forth-like. 


Sent from Yahoo Mail for iPhone

On Monday, January 4, 2021, 3:18 PM, Bob Armstrong <bob@cosy.com> wrote:

Excellent !

That implies you are understanding quite a lot !

Have you ever used a Forth before ?

I'm trying to find as much time as I can to lock up exception handling . But a lot of it is deeper in the Forth than I have been motivated to dig before . Getting the APL solid and fleshed out and the environment useful for my daily tasks has been the priority .

I'm now going to work thru Reva: Intermediate Tutorial particularly getting an understanding of the memory map . Being able to work w/i the CoSy environment with its search fns , and now the ability to set the cursor to where things are found in the file will be a great advantage .

BobA

| --

On 2021-01-02 12:57, andrew warren wrote:
Thanks: Changing script0 worked, once I figured out I needed to execute ` script0 -> 


On Saturday, January 2, 2021, 12:12:32 PM EST, Bob Armstrong <bob@cosy.com> wrote:


On 2021-01-02 05:30, andrew warren wrote:
Correction. I looked at your screen on the video, and I don't see the stack or the buttons on the bottom, below the text, that you have on your screen.
Perhaps the font and sized of the CoSy window is too tall for your screen ?  I now have a 4K screen and it's like finally having my whole desktop on my desktop . But for a long time I've had either  1920x1080 HD or , until it failed 1920x1200 .  You should see the full screen as visible in the Hello World YouTube , including the $tack display ( $ as an indication that it's hex ) , and some buttons which I have found I hardly ever use .

I see I have the info on editing the startup script , script0 , in a couple of places in the ` state window . Here's how to set the display parameters :
` script0 ->     | display startup script in ` res window
 You will see that while it has some other stuff , the main thing is setting display parameters and you should see 3  ` [IF] choices with settings I find useful depending on whether on desk or notebook , or projector .
Execute
 ` [IF] Help
for an explanation of Reva's conditional compiling words .

Put a 1 for the set you want and 0 for the others . Hit ctrlS to save , then  bye  and reboot .  Once you try that , you can play with the parameters to optimize for your use .

Let me know how that goes .

BobA

|--
On Saturday, January 2, 2021, 05:40:56 AM EST, andrew warren <treeandysann@yahoo.com> wrote:


Hi Bob, 

I have seen the corruption you describe in your first paragraph at times and I think that's what my problem was yesterday: 

I did a clean start and this morning, ` _i :??  now works, as does
s" _i" ??  which I had tried yesterday and also did not work then.   

I responded to your other questions inline below using the format [aw ... ] 
 
Hope this helps - 
Andy

On Friday, January 1, 2021, 07:42:45 PM EST, Bob Armstrong <bob@cosy.com> wrote:


That's weird .

One thing that I'm looking to solve this weekend is that sometimes when restarted something appears to be saved which is corrupt so on restart even F6ing an empty line will bomb .

If CoSy's working correctly so F6ing a blank line just returns _n , nil , for an empty stack .  ( 
[aw - that works]

Have you noticed the $tack shown at the bottom of the dialog ? 
[aw - yes, except mine's at the top]

One of the main differences between F6 and sF6 is that F6 will try to output whatever is on top of the stack as a CoSy list . And if it's not , will likely bomb . That's one thing I'm looking to lock up .

So , if you just execute
 ` _i
_i
or  ` and any other non-blank string it should just return the string .
[ aw - it does ]
It makes me wonder .  Is  :?? failing for some other reason ?
I see the first example of  ?? I give is on itself , both as | ` ?? ?? | and using the more general string | s" ??" ?? |  Do those work ?
[aw - these both work]

Thanks again for the feedback . And this definitely is building useful documentation .

BobA

| --

On 2021-01-01 13:48, andrew warren wrote:
Thanks for getting back to me Bob - still blows up, even using backtick :( 

And sure, feel free to use my emails for your purposes.


Andy

On Friday, January 1, 2021, 12:38:56 PM EST, Bob Armstrong <bob@cosy.com> wrote:


I've been making progress understanding the underlying Forth exception handling and think will get a lot locked up in a couple of days . I can now  `  set the cursor to anywhere in text I want and working at line 2875 at the end of the year in my WorkLog , it is very nice to have it restart right where I left off .  It opens up a lot of possible features .

Always useful to see lines in fixed font since space is the prime delimiter . 
I see the issue is apparently that you didn't  ` tick the word  _i .   I'm thinking how to improve the documentation . 
    ` simply returns the next word as a string . I do see that I say
| NB: tick , ` , makes the next word into a string .
| thus
  s" asdf"   ` asdf   match     |>| 1

 ` See :??     | colon definition of a word  equivalent to
 s" : See" ??

While it's quite recent , I like the notion so much for picking out a word that I use it informally in general writing . It's evolved from K's notation for symbol which marks words with a prefixed ` . Eg: the symbol `_i being a symbol type , rather than ` _i simply returning s" _i" as a string . It's a situation where I found having a separate symbol type just complicates things .

In any case , what you need is
   ` _i :??
(
 ./CoSy/CoSy.f
 
: _i ( cell -- 1_item_intvec )
   1 intVecInit >r> 0 ii! r> ;
 
: 2_i ( i i -- iv iv )  _i swap _i swap ;
 
Without the ` , the verb  _i executes , and it ends up handing nothing to :?? which then bombs .

I should emphasize at the same time the difference between ` and ' .  ( I wish I had a font which distinguished them better . )
 ' , the ordinary single quote is a very fundamental Forth word which gives it a great deal of it's power .
Of course a word normally gets executed as soon as Forth sees it in its simple RPN  read it , do it syntax . What quote , ' , does is return the execution address , the ` xt  of the next word rather than executing it . Thus it's as trivial to put a verb on the stack as noun ( which puts its own address on the stack ) . And it makes what APL calls operators , and J calls adverbs trivial . It's as easy to pass a verb ( function ) as an argument as a noun ( data ) .

Since it's a basic Forth word , it's documented in the Reva Forth help .
  ` ' Help
' ( <name> -- xt ) 'forth
Context: ~
Source in: src/reva.f
    Look up the word "<name>" in the dictionary.  Returns the xt of
    the word in question, or 0 if "<name>" doesn't exist.
   
See also: '' (create) (header) [ ['] ] back compile create does> find find-dict findprev func: func:>xt header vfunc:

I hope that clarifies things .  May I post this on http://www.cosy.com/CoSy/AskMeAnything.html ? I think it's quite valuable documentation .

Thanks again for the feedback .  And may 2021 be a righteous and prosperous year 😌 .

BobA

Peace thru Freedom
Honesty enforced thru Transparency ,
CoSy  The Shortest Path from the Chip to the Math
I reserve the right to post all communications I receive or generate to CoSy website for further reflection

| --

On 2021-01-01 06:03, andrew warren wrote:
Happy New Year CoSy Bob!

I got CoSy to crash. I was following along with your Youtube Zoom video . 
_i :?? crashes it every time.

But other than that, it's working better than it ever has for me.


Still looking for that old laptop (I have a collection of ancient IBM Thinkpads that I got free from a past job.) One of them had APL CoSy and was setup so that the APL fonts worked correctly.
 

On Thursday, December 31, 2020, 10:31:45 AM EST, andrew warren <treeandysann@yahoo.com> wrote:


So far so good! No crashes. I have made many changes to my windows 10 enironment - windows updates and virtualization. 


Sent from Yahoo Mail for iPhone

On Thursday, December 31, 2020, 10:19 AM, andrew warren <treeandysann@yahoo.com> wrote:

Bob i redownloaded cosy and made it farther than ever before. I will try later on today but so far it hasnt crashed


Sent from Yahoo Mail for iPhone

On Wednesday, December 30, 2020, 5:48 PM, Bob Armstrong <bob@cosy.com> wrote:

I am spending this week focused on preventing and catching bombs . See the em conversation with Rémy Clarke I just see did not format very well on http://www.cosy.com/CoSy/AskMeAnything.html .

Wow , the APL CoSy is going back ! But the fundamental nature is the same .  I hope my old 1.44 disks will be readable whenever I start assembly my memoirs in a decade or so .
 


CoSy failed for Rémy when he F6ed
R
to show the whole root dictionary . It should have worked . looping thru it works
  R dsc  R 1 _at ' fmt 'm ,L flip
 res> # |>| 211962     | over 200k chars

Anyway , need to get back at it .

BobA

| --

On 2020-12-30 11:43, andrew warren wrote:
I could do Hello World but it crashed after that. 
I’m looking for my old laptop that had APL CoSy :)


Sent from Yahoo Mail for iPhone

On Saturday, December 26, 2020, 8:50 PM, Bob Armstrong <bob@cosy.com> wrote:

You mean it failed to even boot up to the screen in the Hello World demo ?   And it's not a problem with virus checkers ?

Thanks ,

On 2020-12-25 14:42, andrew warren wrote:
Thanks Bob. I did try CoSy again recently under win 10 but it crashed almost immediately :(


Sent from Yahoo Mail for iPhone

On Friday, December 25, 2020, 4:32 PM, Bob Armstrong <bob@cosy.com> wrote:


--
Bob A

Peace thru Freedom
Honesty enforced thru Transparency ,
I reserve the right to post all communications I receive or generate to CoSy website for further reflection
--


--
Bob A

Peace thru Freedom
Honesty enforced thru Transparency ,
CoSy  The Shortest Path from the Chip to the Math
I reserve the right to post all communications I receive or generate to CoSy website for further reflection
--