📄 no.011.mal
字号:
# Monet Mil to Mal compiler# Copyright (c) 2001-2004, CWI. All rights reserved.#Predefined code segment#The compiler can not guarantee an accurate compilation,#because MIL unlike MAL is a dynamically typed language.#A few guidelines to maximize usefullness.#- make the type of variables explicit, in particular 'nil'#- upon advice of M2m to remap identifiers, change it in your program directly#use the "mil_schema" for additional support routines# io.print("# >Number: 11\n");# io.print("# >Category: Mserver\n");# io.print("# >Synopsis: batloop operator on bbp.new(int, nil) hangs...\n");# io.print("# >Confidential: no\n");# io.print("# >Severity: serious\n");# io.print("# >Priority: low\n");# io.print("# >Responsible: boncz\n");# io.print("# >State: closed\n");# io.print("# >Class: sw-bug\n");# io.print("# >Submitter-Id: unknown\n");# io.print("# >Arrival-Date: Mon Jul 14 17:30:01 1997\n");# io.print("# >Originator: jonas\n");# io.print("# >Organization:\n");# io.print("# >Release: 970101\n");# io.print("# >Environment:\n");# io.print("# 3.06 hacked\n");# io.print("# >Description:\n");# io.print("# The following hangs the Mserver:\n");# io.print("# \n");# io.print("# f := bbp.new(int, nil);\n");# io.print("# f.insert(1,10);\n");# io.print("# f.insert(2,20);\n");# io.print("# f.insert(3,30);\n");# io.print("# f.print();\n");# io.print("# f@batloop() { $head.print(); $tail.print(); }\n");# io.print("var f := bbp.new(int, 0);"); f := bbp.new(nil:int,0);# io.print("f.insert(1,10);"); aa_a := bat.insert(f,1,10);# io.print("f.insert(2,20);"); ba_a := bat.insert(f,2,20);# io.print("f.insert(3,30);"); ca_a := bat.insert(f,3,30);# io.print("f.print();"); da_a := bat.print(f);# io.print("f@batloop() { $head.print(); $tail.print(); }");barrier (ea_a,ea_aH,ea_aT) := newIterator(f); fa_a := bat.print(ea_aH); ga_a := bat.print(ea_aT);redo (ea_a,ea_aH,ea_aT) := hasMoreElements(f);exit (ea_a,ea_aH,ea_aT) ;# io.print("var h := bbp.new(int, void);"); h := bbp.new(nil:int,nil:void);# io.print("h.insert(1,void(10));"); ha_a := void(10); ia_a := bat.insert(h,1,ha_a);# io.print("h.insert(2,void(20));"); ja_a := void(20); ka_a := bat.insert(h,2,ja_a);# io.print("h.insert(3,void(30));"); la_a := void(30); ma_a := bat.insert(h,3,la_a);# io.print("h.print();"); na_a := bat.print(h);# io.print("h@batloop() { $head.print(); $tail.print(); }");barrier (oa_a,oa_aH,oa_aT) := newIterator(h); pa_a := bat.print(oa_aH); qa_a := bat.print(oa_aT);redo (oa_a,oa_aH,oa_aT) := hasMoreElements(h);exit (oa_a,oa_aH,oa_aT) ;# io.print("var k := bbp.new(int, void);"); k := bbp.new(nil:int,nil:void);# io.print("k.insert(1,void(nil));"); ra_a := void(nil); sa_a := bat.insert(k,1,ra_a);# io.print("k.insert(2,void(nil));"); ta_a := void(nil); ua_a := bat.insert(k,2,ta_a);# io.print("k.insert(3,void(nil));"); va_a := void(nil); wa_a := bat.insert(k,3,va_a);# io.print("k.print();"); xa_a := bat.print(k);# io.print("k@batloop() { $head.print(); $tail.print(); }");barrier (ya_a,ya_aH,ya_aT) := newIterator(k); ab_a := bat.print(ya_aH); bb_a := bat.print(ya_aT);redo (ya_a,ya_aH,ya_aT) := hasMoreElements(k);exit (ya_a,ya_aH,ya_aT) ;# io.print("var g := bbp.new(int, int);"); g := bbp.new(nil:int,nil:int);# io.print("g.insert(1,10);"); cb_a := bat.insert(g,1,10);# io.print("g.insert(2,20);"); db_a := bat.insert(g,2,20);# io.print("g.insert(3,30);"); eb_a := bat.insert(g,3,30);# io.print("g.print();"); fb_a := bat.print(g);# io.print("g@batloop() { $head.print(); $tail.print(); }");barrier (gb_a,gb_aH,gb_aT) := newIterator(g); hb_a := bat.print(gb_aH); ib_a := bat.print(gb_aT);redo (gb_a,gb_aH,gb_aT) := hasMoreElements(g);exit (gb_a,gb_aH,gb_aT) ;# io.print("quit();"); jb_a := clients.quit();
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -