{"size": 666, "ext": "js", "max_stars_repo_path": "experimental/value/level2.js", "max_stars_repo_name": "harupiyo/Living-a-little-lisp-in-JavaScript", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "experimental/value/level2.js", "max_issues_repo_name": "harupiyo/Living-a-little-lisp-in-JavaScript", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "experimental/value/level2.js", "max_forks_repo_name": "harupiyo/Living-a-little-lisp-in-JavaScript", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 14.170212766, "max_line_length": 70, "alphanum_fraction": 0.6591591592}
/*
- 定数の表現
- スペシャル変数
	- これはシンボル側で管理しているかな？

*/

export class Value {
	constructor(type,val){
		this.tag = {
			type: type,
			constant: false,
		}
		this.val = val;
	}
	set(new_type,new_value){
		if (this.tag.constant) {
			throw("[TODO] The SYMBOL is a constant and thus can't be set.")
				// ↑にシンボル名を入れたい。ということはここではエラーを報知するだけにするか、定数かどうかをシンボル側に持たせるかのどちらかだ。
		}
		this.tag.type = new_type
		this.val = new_value
	}
}

export function make_constant( value_obj ){
	value_obj.tag.constant = true
}


/*
let v = new Value("INT",1)
console.log(v)

v.set("INT",10)
console.log(v)

make_constant(v)

try {
	v.set("INT",100)
	console.log(v)
}catch(e){
	console.log(e)
}
*/
