背景:
阅读文章

LPC基础数据类型--function

[日期:2008-12-25] 来源:  作者: [字体: ]
我贴一些在mudos的changlog里面找到的东西,作为补充说明。

Fri Oct 6 18:58:01 EDT 1995 (tim@handel.princeton.edu (Beek))

     * bumped version number to v21.6
     * LPC->C support:
      . annonymous functions, function pointers,
     * compiler changes:
      . warning for (: string constant :)
Sat Jan 21 20:25:44 EST 1995 (tim@handel.princeton.edu (Beek))
    * raised patchlevel to v20.26
     * added support for pass-by-value to function pointers. The
      syntax is $(expression), where "expression" will be run when
      the function pointer is made, not when it is evaluated.
      Note the difference between (: this_object() :) and
      (: $(this_object()) :)
     * added anonymous functions. The syntax is:
        function( <argument list> ) { <code> }
        for example:
        create() {
        function f;

        f = function(int x) {
          int i;
          for (i = 0; i < x; i++) { write(i+""); }
        };
        evaluate(f, 10);
        }
Thu Nov 10 09:08:26 EST 1994 (tim@handel.princeton.edu (Beek))
    * raised patchlevel to v20.18
     * removed the entry in the Bugs file for f=(: ob, ({ func, a, b }) :)
      since NEW_FUNCTIONS fixes this already
Sat Sep 24 16:51:06 EDT 1994 (tim@handel.princeton.edu (Beek))
    * raised patchlevel to v20.10
     * made nesting of (: $var :) functionals work correctly
     * Added support for the second to last version of function
      pointers; "(: expression :)". Arguments to the function
      are represented as $1, $2, $3 ...
      For example:
      sort_array(arr, (: sizeof($1) < sizeof($2) :) );
Mon Aug 29 17:47:41 EDT 1994 (tim@handel.princeton.edu (Beek))
    * raised patchlevel to v20.1
     * efun, lfun, and simul_efun pointers are now available.
      Examples:
      function f = (: previous_object, -1 :);
     
      int foo() { }
      ...
      function f = (: foo :);

     * arguments can be passed either by including them in the
      definition:
      function f = (: write_file, "/log/fp", "evaluated.\n" :)

      or when evaluated:
      function f = (: explode :);
      result = (*f)("this is a test", " ");
收藏 推荐 打印 | 录入:sbso | 阅读:
相关内容      
本文评论   [发表评论]   全部评论 (0)
内容推送
52mud提供
一起回忆泥巴游戏QQ群68186072
52mud官方微信公众平台
热门评论