As far as I remember it looked nice on paper:
But where is it typically used? Is the community as small as the other one with a camel, Perl? I remember Perl being used for everything (and scripts being printed in magazines) - then I didn't touch computers in a serious way for some years and it seems to have vanished. Also everyone seems to hate its current version.
OCaml thread
Rust double linked List: doc.rust-lang.org
1660 LOC with comments
C++ doubly linked List: llvm.org
2421 LOC without comments
Your Rust example uses unsafe all over the place.
Common LISP
Common LISP
D
Why is this useful again? Serious question.
Common LISP and D
Of course, nobody really uses Ocaml, D, or CL so maybe people don't like this sort of thing?
At INRIA in France.
...
You know the C++ option does a billion more things right?
Reading these gives me hope that one day APL/J/K/Q will make a come back.
If you want a simple definition you can have one:
struct node
{
int data;
node *next;
};
class linked_list
{
private:
node *head,*tail;
public:
linked_list()
{
head = NULL;
tail = NULL;
}
void add_node(int n)
{
node *tmp = new node;
tmp->data = n;
tmp->next = NULL;
if(head == NULL)
{
head = tmp;
tail = tmp;
}
else
{
tail->next = tmp;
tail = tail->next;
}
}
};
It just means that your linked list will be missing all the optimizations, and extra operations you might want to do.
obv you are going to want more things like delete node, a system for iterating, etc.