News for hackers. Stuff that matters.
Re:SML#: a new Standard ML family programming language by Mindless2112 on Saturday July 20, 2013 @02:16AM (#6074483)
"Functional record update" [1] was the one missing feature that bothered me most about Standard ML. If you want to change one element in a record, you've got to specify explicitly that every other element in the record didn't change.

[1] http://www.pllab.riec.tohoku.ac.jp/smlsharp/docs/1.0/en/Ch4....

Re:SML#: a new Standard ML family programming language by mackwic on Saturday July 20, 2013 @06:08AM (#6074807)
You can also update one field in OCaml, I really like this language.
Re:SML#: a new Standard ML family programming language by p4bl0 on Saturday July 20, 2013 @10:39AM (#6075345)
I wouldn't use "update" since it imply that there is a modification of the value in the original record. This is possible with mutable field of course, but I think the feature of OCaml (and apparently, SML#) you're talking about is the `with` keyword:

    # type foo = { bar: int ; baz: string };;
    type foo = { bar : int; baz : string; }
    # let a = { bar = 42; baz = "hello" };;
    val a : foo = {bar = 42; baz = "hello"}
    # let b = {a with baz = "bye"};;
    val b : foo = {bar = 42; baz = "bye"}
    # a;;
    - : foo = {bar = 42; baz = "hello"}
Re:SML#: a new Standard ML family programming language by mackwic on Monday July 29, 2013 @11:37AM (#6121731)
You are completely right, thanks for the precision and code sample.