Stack(3) OCaml library Stack(3)NAME
Stack - Last-in first-out stacks.
Module
Module Stack
Documentation
Module Stack
: sig end
Last-in first-out stacks.
This module implements stacks (LIFOs), with in-place modification.
type 'a t
The type of stacks containing elements of type 'a .
exception Empty
Raised when Stack.pop or Stack.top is applied to an empty stack.
val create : unit -> 'a t
Return a new stack, initially empty.
val push : 'a -> 'a t -> unit
push x s adds the element x at the top of stack s .
val pop : 'a t -> 'a
pop s removes and returns the topmost element in stack s , or raises Empty if the stack is empty.
val top : 'a t -> 'a
top s returns the topmost element in stack s , or raises Empty if the stack is empty.
val clear : 'a t -> unit
Discard all elements from a stack.
val copy : 'a t -> 'a t
Return a copy of the given stack.
val is_empty : 'a t -> bool
Return true if the given stack is empty, false otherwise.
val length : 'a t -> int
Return the number of elements in a stack.
val iter : ('a -> unit) -> 'a t -> unit
iter f s applies f in turn to all elements of s , from the element at the top of the stack to the element at the bottom of the stack. The
stack itself is unchanged.
OCamldoc 2014-06-09 Stack(3)
Check Out this Related Man Page
stack(n) Tcl Data Structures stack(n)
NAME
stack - Create and manipulate stack objects
SYNOPSIS
package require Tcl 8.2
package require struct ?1.2.1?
stackName option ?arg arg ...?
stackName clear
stackName destroy
stackName peek ?count?
stackName pop ?count?
stackName push item ?item ...?
stackName size
DESCRIPTION
The ::struct::stack command creates a new stack object with an associated global Tcl command whose name is stackName. This command may be
used to invoke various operations on the stack. It has the following general form:
stackName option ?arg arg ...?
Option and the args determine the exact behavior of the command. The following commands are possible for stack objects:
stackName clear
Remove all items from the stack.
stackName destroy
Destroy the stack, including its storage space and associated command.
stackName peek ?count?
Return the top count items of the stack, without removing them from the stack. If count is not specified, it defaults to 1. If
count is 1, the result is a simple string; otherwise, it is a list. If specified, count must be greater than or equal to 1. If
there are no items on the stack, this command will return count empty strings.
stackName pop ?count?
Return the top count items of the stack, and remove them from the stack. If count is not specified, it defaults to 1. If count is
1, the result is a simple string; otherwise, it is a list. If specified, count must be greater than or equal to 1. If there are no
items on the stack, this command will return count empty strings.
stackName push item ?item ...?
Push the item or items specified onto the stack. If more than one item is given, they will be pushed in the order they are listed.
stackName size
Return the number of items on the stack.
KEYWORDS
queue, matrix, tree, graph
struct 1.2.1 stack(n)
Hi all,
One of our programs written in Java, produced this logfile. This job runs 48 threads and only one thread failed with this error. The code is a blackbox(external product), so cant look at the source code. From what I can infer from the log, the job was trying to write the log messages into... (9 Replies)
Hi,
I am currently working with threads using linux 2.6.11 and glibc 2.3.5 on x86. When i am trying to create thread with user defined stacks glibc gives segmentation fault. I have written a wrapper to pthread_create () and generated shared object for the same. When i am trying to create any... (6 Replies)
I would like to know how I could do the following :
void func(){
int a = 100; b=0;
int c = a/b;
}
void sig_handler (int sig,siginfo_t *info,void *context){
//signal handling function
//here I want to access the variables of func()
}
int main(){
struct sigaction *act =... (7 Replies)
Can someone explain me, why when I create new threads with stack bigger than default (using pthread_attr_setstacksize()) i can create more? Each thread has it's own stack, so how bigger stack can cause possibility to create more threads? (7 Replies)
Hi All
I would like to use the tool "pstack" to get a sample of the stack trace for a process.
As far as I understood It seems widely available in all Linux systems, but it is not in Ubuntu 10.10.
I tried using apt-get as per some posts in few forum, but it cannot be found in the APT... (9 Replies)
I have a java process that piles up the stack memory.
ulimit -a
core file size (blocks, -c) unlimited
data seg size (kbytes, -d) unlimited
file size (blocks, -f) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 10
stack size ... (9 Replies)
Hi All,
I have set max stack size as 4KB for my thread, but it always using very less.
So I like to know what is the maximum stack size is used by my thread.
I tried with gcc -fstack-usage command line option, but its not supported by mips.
Kindly suggest me the way to find the max stack... (6 Replies)
How do I stack several columns of data into their own rows?
In:
A,B,C,d,e,f,g,H,I
1,2,3,4,5,6,7,8,9
Out:
A,B,C,X,Y,H,I
1,2,3,d,4,8,9
1,2,3,e,5,8,9
1,2,3,f,6,8,9
1,2,3,g,7,8,9
Mike (10 Replies)
Hi everyone,
Our Red Hat server hung yesterday, and I managed to log into the console and see the following message:
RIP: 0010: mwait_idle_with_hints+0x66/
0x67
RSP: 0018:ffffffff80457f40 EFLAGS: 00000046
RAX: 0000000000000010 RBX: ffff810c20075910 RCX: 0000000000000001
RDX:... (6 Replies)
I have a Solaris 10 server with the following interfaces:
ifconfig -a
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1 inet 127.0.0.1 netmask ff000000
e1000g0: flags=209040843<UP,BROADCAST,RUNNING,MULTICAST,DEPRECATED,IPv4,NOFAILOVER,CoS> mtu 1500 index... (8 Replies)
Where do you go to participate in technical discussions besides UNIX.COM and why?
Personally, I do not really participate in other forums and discussion boards, but I do ask questions from time to time on Stack sites. The problem I have with Stack is that my questions are never answered on any... (30 Replies)
In a Redhat Linux environment, I could run salt commands on the $ prompt but not inside my bash scripts.
It will say command not found and the $PATH variable is exactly the same outside and inside the script.
!#/usr/bin/bash
echo “running”¯
salt "*" cmd.run ‘ls'
exit
Output:-... (8 Replies)