cyt
The Qu Programming Language 1.01 (Default)
 
http://centrin.net.id/~marc/
来自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!')
    ;;
;;

posted on 2005-10-08 14:39 cyt 阅读(731) 评论(2)  编辑 收藏 引用
Comments
  • # re: 一个有趣的Script脚本工具
    阿飞
    Posted @ 2006-04-21 14:30
    redo相当于C#的goto try下面的语句?  回复  更多评论   
  • # re: 一个有趣的Script脚本工具
    cyt
    Posted @ 2006-04-21 22:03
    问题是goto只能goto到指定的地方。redo应该是哪里出错在哪里重新执行。try/goto没有办法回到出错的地方。  回复  更多评论   

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理