《Starting Forth》中文简体版学习笔记

65 views
Skip to first unread message

xiaohao

unread,
May 26, 2011, 4:30:04 AM5/26/11
to Forth中国社区
原来放在QQ群邮件中的,现在搬到这里来。

1,文中空格符号使用的极其不规范,大家注意辨别。

2,书中69页
: ?emit ( c-- ) dup if emit else >>>droop<<< then ;
“droop”这个词多了个“o” 应为“drop”

3,书中91页
:compound 这段代码中的一行
2dup r% + dup + ." Baiance " .
应为 2dup r% + dup ." Baiance " .
多了个“+”号

4,书中97页
代码应为:
: DOUBLED
6 1000 21 1 DO CR ." YEAR " I 2 U.R
2DUP R% + DUP ." BALANCE " .
DUP 2000 > IF CR CR ." more than doubled in "
I . ." years " LEAVE
THEN
LOOP 2DROP ;

7,书中110页
65535 . OD 应为 65535 . OK

8,书中110页
65535 . -1 OK
由于Gforth中单精度直接是32位,所以并不会得到-1的结果。要想得到-1,应输入的数字为4294967295

9,书中114页.date的定义
在gforth中,应该这样
: .date ( ud-- )
<# # # [char] - hold # #
[char] - hold # # #>
type ;

xiaohao

unread,
May 26, 2011, 4:31:21 AM5/26/11
to Forth中国社区
《Starting Forth》的学习已经中断了好长一段时间了,现在继续~~

胡松涛

unread,
May 26, 2011, 4:49:07 AM5/26/11
to cn...@googlegroups.com
在 Thu, 26 May 2011 16:31:21 +0800,xiaohao <superc...@gmail.com> 写道:

> 《Starting Forth》的学习已经中断了好长一段时间了,现在继续~~
>

支持! 還是這邊比較好.群郵件那邊基本沒啥人看哦.

--
Hu Songtao
works as an English Teacher in weekends
Skype: idisblueflash
Beijing, China

xiaohao

unread,
May 26, 2011, 5:00:33 AM5/26/11
to Forth中国社区
嗯,考虑到来这里的人都是专业性强一点的,不会像QQ群里有太多的潜水员。哈哈~

On 5月26日, 下午4时49分, 胡松涛 <idisbluefl...@gmail.com> wrote:

胡松涛

unread,
May 26, 2011, 5:08:41 AM5/26/11
to cn...@googlegroups.com
在 Thu, 26 May 2011 17:00:33 +0800,xiaohao <superc...@gmail.com> 写道:

> 考虑到来这里的人都是专业性强一点的

沒錯,這一點很重要.業餘害死人啊.
Reply all
Reply to author
Forward
0 new messages