New Cat Tutorial

2 views
Skip to first unread message

Christopher Diggins

unread,
Oct 31, 2006, 1:56:43 AM10/31/06
to concatenative, catla...@googlegroups.com, langs...@yahoogroups.com
I just posted a tutorial on the Cat programming language to
http://www.cat-language.com/tutorial.html . There is also some new
enhancement to the Cat interpreter (bug fixes, more commands, and more
tests). Test coverage is now up to 175 tests.

Christopher Diggins
http://www.cat-language.com

James Tauber

unread,
Oct 31, 2006, 8:43:14 PM10/31/06
to catla...@googlegroups.com

Minor nit, but shouldn't the main stack at the end of the Boolean
Values and Comparison be

false true

?

James
--
James Tauber http://jtauber.com/
journeyman of some http://jtauber.com/blog/

Christopher Diggins

unread,
Oct 31, 2006, 9:58:02 PM10/31/06
to catla...@googlegroups.com
Yes, thank you very much for catching that! I appreciate any
nit-catching like this, it is very helpful!

- Christopher

Christopher Diggins

unread,
Nov 3, 2006, 11:38:08 PM11/3/06
to concat...@yahoogroups.com, catla...@googlegroups.com
In response to Manfred's concerns , I updated the Cat interpreter with line continuations as described in the previous post. The new release is numbered 0.9.5.1 and be downloaded at http://www.cat-language.com/download.html . I have also made some updates to the manual at http://www.cat-language.com/manual.html .
 
What would be particularly helpful at this point would be a critique of the manual. However, any feedback would be appreciated.
 
Thanks,
Christopher
 

 
On 11/2/06, Christopher Diggins <cdig...@gmail.com> wrote:
Hi Manfred,
 
Thanks for the example. First, even if the "\" were neccessary for the case of unterminated lists or quotations, the placement of it after map is artificial.
 
>> [ [ f ] map ] map
>> [ g ] filter
 
should have precisely the same meaning as:
 
>> [ [ f ] map ] map [ g ] filter
 
At least this is how Cat works, and is my understanding of how the Joy interpreter should work as well.
 
In theory the Cat interpreter can infer that the current expression is not complete, i.e. when a square bracket, paranthesis or curly brace remain unclosed. In which case the session might look like:
 
>> [ [1 2 3]
\ [5 6 7]
\ [4 9 8] ]
>> [ [ f ] map ] map
>> [ g ] filter
 
The "\" character would be a prompt generated by the interpreter which means "finish your expression". As I mentioned earlier the other line breaks wouldn't change the meaning of the code.
 
So there technically is no need for a line terminator character or continuation character in Cat. It just requires a bit of tricky code logic to achieve. Though I did implement in an earlier version of Cat, the current version doesn't support such smart line breaking in the interpreter. I will try to add it soon, and I appreciate you bringing the concern to my attention.
 
Cheers,
Christopher
 

 
On 11/2/06, Manfred Von Thun <m.vo...@latrobe.edu.au > wrote:



On 1/11/06 1:55 PM, "Christopher Diggins" <cdig...@gmail.com> wrote:
>
> On 10/31/06, Manfred Von Thun <m.vo...@latrobe.edu.au
> <mailto: m.vonthun%40latrobe.edu.au> > wrote:
>
> [..]
>> > Just one quibble, and I think it is an important one:
>> > You obviously want to avoid having a terminator (such
>> > as "." in Joy), and instead take end-of-line to mean
>> > "end of input, run interpreter".
>
> Except in the case of function definitions. In such case as "define x
> { ... }" the closing curly brace indicate the end of the input in the
> case of working with the interpreter. This is not working though in
> the current version.
>
> In the light of this, do you still feel that a termination character
> is neccessary?
>
> I can't imagine any scenario where this wouldn't be adequate, so any
> counter-examples would be helpful.

counterexample: suppose that I have defined all sorts of functions, and
I now want to use them to do something to a list of lists. Pretend that
Joy needs a continuation character ³\².
>> [ [1 2 3] \
>> [5 6 7] \
>> [4 9 8] ] \
>> [ [ f ] map ] map \
>> [ g ] filter
Would you prefer this over NOT needing ³\², instead having a single
³.² after ³filter²?

Best wishes

- Manfred

[Non-text portions of this message have been removed]

__._,_.___
SPONSORED LINKS
Search Ads

Get new customers.

List your web site

in Yahoo! Search.

Your Story

Opened in the 2020

The Yahoo! Time

Capsule Project

Yahoo! Groups

Start a group

in 3 easy steps.

Connect with others.

.

__,_._,___


Reply all
Reply to author
Forward
0 new messages