Another update from ingydotnet^djgoku
This commit is contained in:
parent
91df62d461
commit
948b86eafa
7604 changed files with 108452 additions and 22726 deletions
|
|
@ -0,0 +1,8 @@
|
|||
% record type to hold a singly linked list of integers %
|
||||
record ListI ( integer iValue; reference(ListI) next );
|
||||
|
||||
% declare a variable to hold a list %
|
||||
reference(ListI) head;
|
||||
|
||||
% create a list of integers %
|
||||
head := ListI( 1701, ListI( 9000, ListI( 42, ListI( 90210, null ) ) ) );
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
TYPE
|
||||
Link = REF LinkRcd;
|
||||
LinkRcd = RECORD
|
||||
Next: Link;
|
||||
Data: INTEGER
|
||||
END;
|
||||
|
|
@ -1,14 +1,14 @@
|
|||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface RCListElement : NSObject
|
||||
@interface RCListElement<T> : NSObject
|
||||
{
|
||||
RCListElement *next;
|
||||
id datum;
|
||||
RCListElement<T> *next;
|
||||
T datum;
|
||||
}
|
||||
- (RCListElement *)next;
|
||||
- (id)datum;
|
||||
- (RCListElement *)setNext: (RCListElement *)nx;
|
||||
- (void)setDatum: (id)d;
|
||||
- (RCListElement<T> *)next;
|
||||
- (T)datum;
|
||||
- (RCListElement<T> *)setNext: (RCListElement<T> *)nx;
|
||||
- (void)setDatum: (T)d;
|
||||
@end
|
||||
|
||||
@implementation RCListElement
|
||||
|
|
@ -22,8 +22,7 @@
|
|||
}
|
||||
- (RCListElement *)setNext: (RCListElement *)nx
|
||||
{
|
||||
RCListElement *p;
|
||||
p = next;
|
||||
RCListElement *p = next;
|
||||
next = nx;
|
||||
return p;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
enum SingleLinkedList<T> {
|
||||
Node(T, @mut SingleLinkedList<T>),
|
||||
None
|
||||
Node(T, Box<SingleLinkedList<T>>),
|
||||
None
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue