简体   繁体   中英

List of Racket Primitive Functions

Is there a list of Racket built in functions? Im looking for a list sort of like this one for python. I can't seem to find one in the documentation.

Here are some lists:

The index of all functions in the Racket documentation:

http://docs.racket-lang.org/reference/doc-index.html

A cheat sheet:

https://docs.racket-lang.org/racket-cheat/index.html?q=cheatsheet

Now "primitive function" in the context of Racket means all functions implemented in the virtual machine (ie not functions implemented in Racket are excluded), so a third list might also be relevant.

This small program generates a list of all primitives:

#lang racket

(define primitive-table  
  (let ([ns (make-base-empty-namespace)]) ; make namespace with racket/base attached
    (parameterize ([current-namespace ns])
      (namespace-require ''#%kernel)      ; import all primitives
      (namespace-require ''#%unsafe)
      (namespace-require ''#%flfxnum)
      (namespace-require ''#%extfl)
      (namespace-require ''#%futures)
      (namespace-require ''#%foreign)

      (namespace-mapped-symbols))))

primitive-table

On my version of Racket there are 1487 primitives.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM