Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- attr a1
- meth init a1 := nil end
- meth put(X) a1:= X|@a1 end
- meth get($) local X in X = @a1.1 a1:= (@a1.2) X end end
- meth isEmpty($) if @a1 == nil then true else false end end
- meth union(C)
- local Y in
- {C isEmpty(Y)}
- if Y == false then
- local X in
- {C get(X)}
- {self put(X)}
- {self union(C)}
- end
- end
- end
- end
Add Comment
Please, Sign In to add comment