3 ms·
Let this sink in though: [ 'apple' , 'banana' , 'orange' ]
by rapind 1y ago
Let this sink in though:
[ 'apple'
, 'banana'
, 'orange'
]
- maest 1y agoThat makes prepending an element a special case.
- ParetoOptimal 1y agoIt makes it easier to read though because the least important parts are most easily ignored. The reader can focus on the contents of the list.
- Nevermark 1y agoThis is so clearly superior. Delimiters are prefixes. But the scale of technical debt this insight has revealed is depressing.
- citizenkeen 1y agoSaying this is clearly superior means you don’t keep your lists sorted. A sorted list is as likely to add something to the beginning as the end, where this solution has the same problem.
- setr 1y agoThe only correct syntax/format [ , a , b , c ] If only there existed a language designer intelligent enough to support it
- maccard 1y agoYou want yaml key: - a - b - c
- crazygringo 1y agoThank you for the humor! I'm just suddenly slightly terrified someone's going to see this and think it's genuinely a good idea and make it part of the next popular scripting language, where lists are defined by starting commas or something :S
- MonkeyClub 1y agoLisp: ( a b c )
- Nevermark 1y agoI just reverse the sort order when that case happens.
- JBiserkov 1y agoIn Clojure, commas are treated as whitespace and are thus completely optional.