feature req: limited stack

new topic     » topic index » view thread      » older message » newer message

For example:

include std/stack.e
stack MyStack = new(FILO, 20) 
for i = 1 to 21 do 
  push(MyStack, i) 
end for 
? size(MyStack) 
? last(MyStack) 
? top(MyStack)

Output:

20 
2 
21 

It is useful for programming cached structures. May be, better to create my own type "cache"? Something similar to map, but with timestamps of last access.

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu