Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a DList?

I tried googling for this but all I got were stories about minor celebrities. Given the lack of documentation, what is a DList?

like image 729
oxbow_lakes Avatar asked Jul 28 '10 11:07

oxbow_lakes


People also ask

What is a Dlist celebrity?

The D-list is for a person whose celebrity is so obscure that they are generally only known for appearances as celebrities on panel game shows and reality television.

What is a C list celebrity?

A category of celebrities, originally referring to Hollywood actors; see A-list. C-list (computer security), a list of capabilities that a process or protection domain has direct permission to access.

What is known as a distribution list?

In email applications, a distribution list is a list of email addresses that can be mass mailed via automation without having to add members individually. Distribution lists are used to send emails to groups of people without having to enter each recipient's individual address.


1 Answers

It's a Difference List, along the lines of "Difference List as functions"

scala> val (l1, l2, l3) = (List(1, 2, 3), List(4, 5, 6), List(7, 8, 9)) l1: List[Int] = List(1, 2, 3) l2: List[Int] = List(4, 5, 6) l3: List[Int] = List(7, 8, 9) 

Efficient prepending:

scala> l1 ::: l2 ::: l3 res8: List[Int] = List(1, 2, 3, 4, 5, 6, 7, 8, 9) 

Inefficient appending. This creates an intermediate list (l1 ++ l2), then ((l1 ++ l2) ++ l3)

scala> l1 ++ l2 ++ l3  // inefficient res9: List[Int] = List(1, 2, 3, 4, 5, 6, 7, 8, 9) 

DList stores up the appends, and only needs to create one complete list, effectively invoking:

scala> List(l1, l2, l3) reduceRight ( _ ::: _)  res10: List[Int] = List(1, 2, 3, 4, 5, 6, 7, 8, 9) 
like image 79
retronym Avatar answered Sep 30 '22 02:09

retronym