Seven More Languages in Seven Weeks (读书笔记):Factor
2016-03-30 15:14
375 查看
Factor
IN: scratchpad 20 9 * 5.0 / 32 + .Booleans:t/f
Sequences:{ { "one" 1 } { "two" 2 } { "three" 3 } { "four" 4 } } //注意空格
Quotations(匿名函数):[ 42 + ]
call
条件语句
IN: scratchpad 10 0 > [ "pos" ] [ "neg" ] if .
或 IN: scratchpad 10 0 > "pos" "neg" ? .
Stack Shuffling
dup, drop, nip, swap, over, rot, pick
Higher-Order Words with Combinators
IN: scratchpad 44.50 [ 0.05 * ] [ 0.09975 * ] bi //见鬼
bi*
bi@
tri tri* tri@
Vocabularies
IN: scratchpad USE: present
IN: scratchpad SYMBOL: tax-rate //What the Fuck!
: greeting ( name -- greeting ) "Hello, " swap append ; //定义一个库函数?IN: examples.greeter
: hello-world ( -- ) "world" greeting print ; //USE: examples.greeter
Tuples
TUPLE: cart-item name price quantity ; //?类型没有声明
price>>(读)
>>price(写)
change-price
"Seven Languages Book" 25.00 1 cart-item boa //By Order of Arguments
标准库(字典):略
IN: scratchpad "demos" run
相关文章推荐
- 微软Word 2007数学插件 Microsoft Math 提供下载
- Office Word九条常用技巧
- C#实现简单合并word文档的方法
- powershell操作word详解
- C#生成Word文档代码示例
- 用vbscript把 Word 文档保存为文本文件的代码
- 如何使用C#从word文档中提取图片
- C#根据Word模版生成Word文件
- C#采用OpenXml给Word文档添加表格
- C#实现合并多个word文档的方法
- C#采用OpenXml给word里面插入图片
- C#使用Word中的内置对话框实例
- C#生成word记录实例解析
- VB调用Word拼写检查功能实例
- C# WORD操作实现代码
- 比较全的一个C#操作word文档示例
- C#添加、读取Word脚注尾注的方法
- jquery Moblie入门―hello world的示例代码学习
- asp.net中Word转Html的办法(不需要WORD组件)
- PHP创建word文档的方法(平台无关)