又一个Scrip脚本工具

The Qu Programming Language 1.06 (Default)
 
来自http://www.freshmeat.net
好像比较有趣,程序比较小,还没有时间看。据作者说性能不错:
"All I can tell you is that on my Pentium(R) 4 CPU 1.70GHz 
with 256 KB Cache and 256 MB RAM running Linux 2.4 and KDE-2,
Qu is generally faster than Perl-5.6, Python-2.3 and Ruby-1.8.
It is significantly slower than C, of course."
支持Exception和OO,比较有趣的是Exception的处理,下面是它给出的例子:
hello

sub hello (msg = nil)
    
```
    Prints a message for the world.
    ```

    local head = false
    do try
        msg is Str or throw EArgType, "me want string"
        msg.('len') or throw EArgValue
        print (msg.ufirst)
        head = true
    catch EArg
        msg = `hello`
        redo /* 就是这里,呵呵,还可以redo,有趣。 */
    finally
        assert (head is true, "eh?")
        
/*
            Lets do this right
        */

        println (' World!')
    ;;
;;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值