News for hackers. Stuff that matters.
Re:Replacing Python by njharman on Sunday September 29, 2013 @12:37PM (#6465628)
I do not understand at all author's statement that OCaml datastructures are big win over Python's

  let {cache; config} = b in
  print_endline (String.concat "," cache);
  print_endline (String.concat "," config)
  ;;
vs, actually I'm not even sure what the ocaml is attempting, some variation of

  print '%s,' % b.cache
  print '%s,' % b.config
Which, in Python, if your printing more than a few should be

  print ',\n'.join((b.config, b.cache, b.data))
Or if want all fields and they are in correct order

  print ',\n'.join(b)
>> The syntax [of NamedTuples] isn’t great, though, and you can’t do pattern matching on the names, only by remembering the order:

Other than misuse of term "pattern matching", that statement is true and is trivially overcome with two line function, one line lambda, or once and for all by subclassing NamedTuple. Here's the function variant:

  def GimmieThing(keyword args in any order)
     return ThingNamedTuple(args in correct order)
Re:Replacing Python by anaphor on Sunday September 29, 2013 @04:57PM (#6466496)
How is it a misuse of the term "pattern matching" ?
Re:Replacing Python by njharman on Monday September 30, 2013 @08:52AM (#6469274)
Generically http://en.wikipedia.org/wiki/Pattern_matching

And as for a language / call semantic look at Erlang for what actual pattern matching looks like.

Re:Replacing Python by anaphor on Monday September 30, 2013 @12:53PM (#6470667)
That doesn't contradict the use of pattern matching in OCaml.
Re:Replacing Python by njharman on Tuesday October 01, 2013 @09:07AM (#6475808)
Both the OA and myself are talking about Python.