On this page:
const
flip
8.12

3.1 函数🔗

一些辅助函数,该模块已经导出了racket/functionidentity

procedure

(const a b)  a

  a : any/c
  b : any/c
重新定义const,原因在于racket/function的const并没有柯里化处理。这版本已实现全部柯里化。

Examples:
> (const 1 2)

1

> ((const 1) 2)

1

procedure

(flip f)  (-> b a c)

  f : (-> a b c)
反转函数入参顺序,某些场景还是挺有用。

Examples:
> (define f (flip string))
> (string #\A #\B)

"AB"

> (f #\A #\B)

"BA"