Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 513
Vityou Avatar asked Dec 01 '25 09:12

Vityou


1 Answers

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 (i.e. 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.

like image 97
soegaard Avatar answered Dec 04 '25 13:12

soegaard



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!