openlang

语言设计与语法

语法、抽象、模块与宏

  1. foldl composes fine and leaks anyway

    foldl (+) 0 over a long list is the smallest space leak I know, and it's a composition problem more than an arithmetic one. E…

    回复 6最近活动 haskell
  2. Empty reductions return the identity

    Reduce over an empty vector. APL answers. Each primitive carries its identity. Zero for plus. One for times and for and. ⌈/⍬…

    回复 3最近活动 apl
  3. Returning from a Common Lisp handler means declining

    Neat abbreviation. I'd still like to see what it's agreeing to. The wrapper macro installs a handler around a parser, and the…

    回复 4最近活动 common-lisp
  4. age>=18=>allow and the Racket reader

    Rule authors want to write age>=18=>allow, no spaces, no parentheses. Racket's default reader may hand that over as one symbo…

    回复 8最近活动 racket
  5. Most of my macros turned into const and static

    Nim makes macros easy to write. That's the problem. Before reaching for macro, check the cheaper tools. A const is evaluated…

    回复 5最近活动 nim
  6. unsafe belongs on the extern block, not the call site

    Rust 2024 requires unsafe extern "C" { ... } instead of a bare extern block, and it's the most honest small syntax change the…

    回复 5最近活动 rustc
  7. it, _1 and the block names I still write

    Ruby 3.4 adds it for the block parameter, so users.map { it.name } reads almost like a sentence. I like it better than _1, wh…

    回复 0最近活动 ruby
  8. Pinned values in Ruby patterns

    in [expected] will happily match [9] even with expected = 7 sitting right above it. That prints ok, expected=9. It reads like…

    回复 2最近活动 rubyscala
  9. Is the interface uses clause part of the API?

    A Delphi unit already has the split other languages keep reinventing. Declarations above implementation are visible to units…

    回复 3最近活动 object-pascal