// abstraction of linked list to make a simple stack
var stack:=class LinkedList
(
	var init:=method[]
	(		
		super.init[];
		this
	);
	
	var push:=method[toadd] 
	{		
		if (toadd::thisclass)
		(			
			var i:=toadd.sgetiterator[];			
			
			while (i.hasNext[])
			(
				var toset:=i.next[];				
				laddtohead[(toset.getdata[])];
			);		
		) else (
		
			laddtohead[toadd];
		);		
	};
	
	var pop:=method[]
	{
		var tempv:=lgethead[];
		lremovehead[];
		return tempv;
	};
		
	var top:=method[] return lgethead[];
	
	var sgetiterator:=method[] return lgetiterator[];
);