HackerTrans
TopNewTrendsCommentsPastAskShowJobs

yallop

no profile record

comments

yallop
·4년 전·discuss


   > Things I Disliked
   > [...]
   > • using ; heavily as element separator (e.g. in lists and records):
   > 
   > let some_list = [1; 2; 3; 4; 5]
   > 
   > You get used to this, but it’s a pretty big departure from the norm to use commas. I wonder what’s the reasoning behind this.
It appears to be a result of the limitations of early parser technology, as Dave MacQueen explains:

    "One of the kind of interesting things is that the parser was written based on Vaughan Pratt's precedence parser [...] and it had the peculiar property that it was hard to reuse symbols for multiple syntactic purposes, and hence you get things like comma used for pairing that means you have to use semicolon for list separator, that means you have to use semicolon-semicolon for statement separator, so there's some peculiarities based on the fact that we didn't really know how to parse and we accepted this quick hack from Vaughan Pratt"
    (https://www.youtube.com/watch?v=ua3EYopCURo&t=179s)