Sync
This commit is contained in:
parent
6f050a029e
commit
776bba907c
3887 changed files with 59894 additions and 7280 deletions
|
|
@ -1 +1,3 @@
|
|||
Define the data structure for a [[singly-linked list]] element. Said element should contain a data member capable of holding a numeric value, and the link to the next element should be mutable.
|
||||
|
||||
{{Template:See also lists}}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,15 @@
|
|||
MODE DATA = STRUCT ( ... );
|
||||
# -*- coding: utf-8 -*- #
|
||||
CO REQUIRES:
|
||||
MODE OBJVALUE = ~ # Mode/type of actual obj to be stacked #
|
||||
END CO
|
||||
|
||||
MODE LINK = STRUCT (
|
||||
REF LINK next,
|
||||
DATA value
|
||||
MODE OBJNEXTLINK = STRUCT(
|
||||
REF OBJNEXTLINK next,
|
||||
OBJVALUE value # ... etc. required #
|
||||
);
|
||||
|
||||
PROC obj nextlink new = REF OBJNEXTLINK:
|
||||
HEAP OBJNEXTLINK;
|
||||
|
||||
PROC obj nextlink free = (REF OBJNEXTLINK free)VOID:
|
||||
next OF free := obj stack empty # give the garbage collector a BIG hint #
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
new( Data ) -> erlang:spawn( fun() -> loop( Data, nonext ) end ).
|
||||
Loading…
Add table
Add a link
Reference in a new issue