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

📄 no.107.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("setoid(oid(20000000));");	aa_a := calc.oid(20000000);	ba_a := setoid(aa_a);#	io.print("# [t_i, n_i]\n");	w:= mil.take("w");	ca_a := histogram(w);	da_a := bat.print(ca_a);#	io.print("#split w in twee tabellen\n");	docid := bbp.new(nil:oid,nil:oid);#	io.print("var tid := bbp.new( void, str );");	tid := bbp.new(nil:oid,nil:str);#	io.print("docid.insert( w.mark(nil).reverse() );");	ea_a := mark(w,nil);	fa_a := bat.reverse(ea_a);	ga_a := bat.insert(docid,fa_a);#	io.print("docid.print();");	ha_a := bat.print(docid);#	io.print("tid.insert( w.reverse().mark(nil).reverse() );");	ia_a := bat.reverse(w);	ja_a := mark(ia_a,nil);	ka_a := bat.reverse(ja_a);	la_a := bat.insert(tid,ka_a);#	io.print("tid.print();");	ma_a := bat.print(tid);#	io.print("docid.seqbase( 1000@0 );");#	io.print("docid.print();");	oa_a := bat.print(docid);#	io.print("tid.seqbase( 1000@0 );");#	io.print("tid.print();");	qa_a := bat.print(tid);#	io.print("tid.reverse().print();");	ra_a := bat.reverse(tid);	sa_a := bat.print(ra_a);#	io.print("var tidx:=tid.copy();");	tidx := copy(tid);#	io.print("tidx.print();");	ta_a := bat.print(tidx);#	io.print("var tidy:=([oid](tid)).copy();");	ua_a := multiplex.tactics("oid",tid);	tidy := copy(ua_a);#	io.print("tidy.print();");	va_a := bat.print(tidy);#	io.print("print( docid, tid );");	wa_a := bat.print(docid,tid);#	io.print("CTgroup( docid, tid ).print();");	xa_a := group(docid,tid);	ya_a := bat.print(xa_a);#	io.print("# t_i, tf_ij\n");	ab_a := bat.reverse(tidx);	bb_a := group(docid,tid);	cb_a := histogram(bb_a);	db_a := algebra.join(ab_a,cb_a);	eb_a := bat.print(db_a);#	io.print("join( tidy.reverse(), CTgroup( docid, tid ).histogram()).print();");	fb_a := bat.reverse(tidy);	gb_a := group(docid,tid);	hb_a := histogram(gb_a);	ib_a := algebra.join(fb_a,hb_a);	jb_a := bat.print(ib_a);#	io.print("join( tid.reverse(), CTgroup( docid, tid ).histogram()).print();");	kb_a := bat.reverse(tid);	lb_a := group(docid,tid);	mb_a := histogram(lb_a);	nb_a := algebra.join(kb_a,mb_a);	ob_a := bat.print(nb_a);#	io.print("# d_j, max tf_j\n");	djtfij := bbp.new(nil:oid,nil:int);#	io.print("djtfij.insert( algebra.join( docid.reverse(), CTgroup( docid, tid ).histogram() ) );");	pb_a := bat.reverse(docid);	qb_a := group(docid,tid);	rb_a := histogram(qb_a);	sb_a := algebra.join(pb_a,rb_a);	tb_a := bat.insert(djtfij,sb_a);#	io.print("{max}(djtfij).print();");	ub_a := group.max(djtfij);	vb_a := bat.print(ub_a);#	io.print("# This way it works. However, if I do not do an explicit new and bat.insert,\n");#	io.print("# then the server crashes as follows:\n");#	io.print("var djtfijx :=join( docid.reverse(), CTgroup( docid, tid ).histogram() );");	wb_a := bat.reverse(docid);	xb_a := group(docid,tid);	yb_a := histogram(xb_a);	djtfijx := algebra.join(wb_a,yb_a);#	io.print("{max}(djtfijx).print();");	ac_a := group.max(djtfijx);	bc_a := bat.print(ac_a);#	io.print("quit();");	cc_a := clients.quit();#Identifer 'CTgroup' mapped to 'group'

⌨️ 快捷键说明

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