⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 id.979809.mal

📁 一个内存数据库的源代码这是服务器端还有客户端
💻 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("var cwd := getenv(\"TSTTRGDIR\");");	cwd := getenv("TSTTRGDIR");#	io.print("var word_file := sprintf(\"%s/ID.979809.txt\", cwd);");	word_file := sprintf("%s/ID.979809.txt",cwd);#	io.print("var word_table:= new(oid,str);");	word_table := new(nil:oid,nil:str);#	io.print("word_table.import(word_file);");	aa_a := import(word_table,word_file);#	io.print("print(\"selecting 'nil' words. The result should be 2\");");	ba_a := print("selecting 'nil' words. The result should be 2");#	io.print("word_table.select(\"nil\").count().print();    # should be 2 and it is 0");	ca_a := select(word_table,"nil");	da_a := count(ca_a);	ea_a := print(da_a);#	io.print("# should be 2 and it is 0\n");#	io.print("print(\"selecting nil values. The result should be 0\");");	fa_a := print("selecting nil values. The result should be 0");#	io.print("word_table.select(str(nil)).count().print();    # should be 1 and it is 3");	ga_a := str(nil);	ha_a := select(word_table,ga_a);	ia_a := count(ha_a);	ja_a := print(ia_a);#	io.print("# should be 1 and it is 3\n");#	io.print("print(\"the table imported\");");	ka_a := print("the table imported");#	io.print("word_table.print();    # the \"nil\" words are converted to nil values     ");	la_a := print(word_table);#	io.print("# the \"nil\" words are converted to nil values     \n");#	io.print("var names := new(void,str).seqbase(0@0);");	ma_a := new(nil:oid,nil:str);#	io.print("names.insert(oid(nil),\"one\");");	na_a := oid(nil);	oa_a := insert(names,na_a,"one");#	io.print("names.insert(oid(nil),\"two\");");	pa_a := oid(nil);	qa_a := insert(names,pa_a,"two");#	io.print("var seps := new(void,str).seqbase(0@0);");	ra_a := new(nil:oid,nil:str);#	io.print("seps.insert(oid(nil),\",\");");	sa_a := oid(nil);	ta_a := insert(seps,sa_a,",");#	io.print("seps.insert(oid(nil),\"\\n\");");	ua_a := oid(nil);	va_a := insert(seps,ua_a,"\n");#	io.print("var types := new(void,str).seqbase(0@0);");	wa_a := new(nil:oid,nil:str);#	io.print("types.insert(oid(nil),\"oid\");");	xa_a := oid(nil);	ya_a := insert(types,xa_a,"oid");#	io.print("types.insert(oid(nil),\"str\");");	ab_a := oid(nil);	bb_a := insert(types,ab_a,"str");#	io.print("var bats := load( names, seps, types, word_file, -1);");	bats := load(names,seps,types,word_file,-1);#	io.print("print(bats.find(\"one\"),bats.find(\"two\"));");	cb_a := find(bats,"one");	db_a := find(bats,"two");	eb_a := print(cb_a,db_a);#	io.print("quit();");	fb_a := quit();

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -