Maintainers
Pricing
Enterprise
More
More
Documentation
Try Live
Rankings
Install
Blog
Docs7
Ask
New
Add Docs
Racket
https://docs.racket-lang.org/
Admin
Racket documentation
Tokens:
4,781,598
Snippets:
54,250
Trust Score:
9.4
Update:
5 months ago
Context
Chat
Benchmark
58.81
Latest
Show doc for...
Code
Info
Show Results
Tokens:
Raw
Copy
Link
Tokens:
Raw
Copy
Link
### Racket Plisqin Module Setup Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/plisqin/Read_Me_First.html Shows how to import the main Plisqin library and set up a prefix for the adventure-works example module, making its schema and functions accessible. ```Racket (require plisqin) (prefix-in aw: plisqin-examples/adventure-works) plisqin-examples/adventure-works/schema ``` -------------------------------- ### Installing Racket-Mike via Mike Itself (Initial) Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/mike/mike-about.html Executes the Racket-Mike main script directly to perform an initial installation and setup from within the cloned repository. ```Shell racket ./mike/main.rkt PACKAGE_NAME=mike install setup ``` -------------------------------- ### Example Usage of Koyo Console Start Procedure Setup in Racket Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/koyo/console.html This snippet provides an example setup for using `start-console`. It shows how to require the necessary modules (`koyo/console` with a prefix and `racket/path`) and how to obtain the path of the current file using `path-only` and `syntax-source`, which can then be used as the `dynamic-module-path` argument for `start-console`. ```Racket (require (prefix-in koyo: koyo/console) racket/path) (define here (path-only (syntax-source #'here))) ``` -------------------------------- ### Installing Qi Package via Raco Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/qi/Introduction_and_Usage.html Provides the command-line instruction using the Racket package manager (`raco pkg`) to install the Qi library. This is a necessary setup step before using Qi. ```Shell raco pkg install qi ``` -------------------------------- ### Installing Frog with Raco Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/frog/Quick_start.html Installs the Frog static blog generator package using the Racket package manager, raco. This command fetches and installs Frog and its necessary dependencies. ```Shell $ raco pkg install frog ``` -------------------------------- ### Install Overscan Racket Package Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/overscan/getting-started.html Installs the Overscan library using the Racket package manager, `raco pkg install`, directly from its Git repository. ```Shell raco pkg install git://github.com:mwunsch/overscan ``` -------------------------------- ### Install GStreamer Good Plugins with AAlib and libvpx Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/overscan/getting-started.html Installs the 'good' set of GStreamer plugins via Homebrew, including optional dependencies like AAlib for ASCII art conversion and libvpx. ```Shell brew install gst-plugins-good --with-aalib --with-libvpx ``` -------------------------------- ### Install GStreamer Base Plugins with Pango Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/overscan/getting-started.html Installs the base set of GStreamer plugins via Homebrew, ensuring the Pango text layout library is included for text overlay functionality. ```Shell brew install gst-plugins-base --with-pango ``` -------------------------------- ### Example Racket Function Call Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/x64asm/Getting_Started.html A simple example showing a call to a Racket function `fib` with an argument, illustrating how Racket code examples are presented in this documentation context. ```Racket (fib 40) ``` -------------------------------- ### Install Ragg Package via Command Line Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/ragg This command uses the `raco setup` utility to install the ragg package from a local PLT file. This method is applicable for Racket versions 5.3.1 and earlier. ```Shell raco setup -A ragg.plt ``` -------------------------------- ### Installing Pygments with Pip Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/frog/Quick_start.html Installs the Pygments library, which is used by Frog for syntax highlighting in fenced code blocks. This requires Python 3 and uses the pip package installer. ```Shell $ python3 -m pip install pygments ``` -------------------------------- ### Build and Preview Site Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/frog/Quick_start.html Regenerates the static site files based on the content and configuration, and then starts a local web server to allow previewing the generated site in a browser. ```Shell raco frog -bp ``` -------------------------------- ### Print Denxi Examples Directory Path (Shell) Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/denxi-guide/index.html Executes a Racket expression from the shell to determine the file path of the Denxi examples collection. This command is provided to help users locate the example code on their local machine for further study and practice. It requires Racket and Denxi to be installed. ```Shell racket -e '(~a (collection-file-path \"examples\" \"denxi"))' ``` -------------------------------- ### Install GStreamer Ugly Plugins with x264 Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/overscan/getting-started.html Installs the 'ugly' set of GStreamer plugins via Homebrew, including the x264 library for H.264 video encoding. ```Shell brew install gst-plugins-ugly --with-x264 ``` -------------------------------- ### Setting up Racket Handin Client (Shell) Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/handin-server/Quick_Start_for_a_Test_Drive.html This command uses 'raco setup' to install or configure the 'handin-client' collection, making it available for use, typically within DrRacket. ```Shell raco setup handin-client ``` -------------------------------- ### Install GStreamer Core via Homebrew Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/overscan/getting-started.html Installs the core GStreamer framework and its dependencies, including GObject Introspection, using the Homebrew package manager on macOS. ```Shell brew install gstreamer ``` -------------------------------- ### Install Ragg Package via Command Line Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/ragg/index.html This command installs the Ragg package using the `raco setup` tool, which is part of the Racket distribution. It provides an alternative method to installing packages via the DrRacket GUI's 'Install PLT File...' option. ```Shell raco setup -A ragg.plt ``` -------------------------------- ### Load and Start Racket Web Server Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/more/index.html Demonstrates the interactive commands used in the Racket REPL to load the server code from a file named 'serve.rkt' and then start the server process, listening for connections on port 8080. ```Racket (enter! "serve.rkt") (serve 8080) ``` -------------------------------- ### Install Darwin using Raco Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/darwin@darwin/Quick_start.html Installs the Darwin blog generator package using the Racket package manager, raco. This command fetches and installs Darwin and its dependencies. ```Shell raco pkg install darwin ``` -------------------------------- ### Install Racket Package as Link Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/vulkan/Setup.html Installs the current directory as a Racket package using a link, useful for contributors working directly with the source code. ```Shell raco pkg install --link ``` -------------------------------- ### Racket Plisqin Example Query Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/plisqin/Read_Me_First.html A demonstration of constructing a query using Plisqin's Racket syntax. It retrieves product details, filters, orders, and limits the results, showcasing the library's query building capabilities. ```Racket (aw:show-table (from p Product (limit 3) (select (ProductName p)) (select (CategoryName p)) (select (TotalSales p)) (order-by 'desc (TotalSales p)))) ``` -------------------------------- ### Using count-iters for Conditional Iteration (Racket) Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/kb-base/Getting_Started_with_Keybindings.html This example illustrates the `count-iters` form, which iterates based on a condition (`forward-sexp-exists?`), a step size (1), and a step type ('sexp'). It continues as long as the condition is true and progress can be made. A setup procedure is used to initialize the editor buffer content and cursor position before running the keybinding program. The form returns the number of successful iterations. ```Racket (test-kb-program (count-iters (forward-sexp-exists?) 1 'sexp) #:setup-proc (λ (editor) (send editor insert "() () ()") (send editor set-position 0))) ``` -------------------------------- ### Building and Previewing Frog Project Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/frog/Quick_start.html Builds the static blog site from the source files and launches a local web server to preview the generated site in a browser. The output shows the server address and instructions to stop it. ```Shell $ raco frog -bp Frog 0.26 Launching /usr/bin/python pipe.py Your Web application is running at http://localhost:3000/index.html. Stop this program at any time to terminate the Web Server. C-c C-c Web Server stopped. ``` -------------------------------- ### Example: Starting a dotmethod Module - Racket Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/dotmethod/index.html Begins an example module using the `#lang dotmethod` extension with `racket` as the base language. ```Racket #lang dotmethod racket ``` -------------------------------- ### Installing Rosette Package (Shell) Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/rosette-guide/ch_getting-started.html This command uses the Racket package manager (raco) to install the Rosette system package. It is the standard way to add Rosette to a Racket installation. ```Shell raco pkg install rosette ``` -------------------------------- ### Introducing Procedures in Racket Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/describe/index.html Prints a header indicating the start of examples related to procedures. ```Racket (printf "~n--- Procedures ---~n") ``` -------------------------------- ### Install Rhombus Package via Raco Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/rhombus/Quick_Start.html This command demonstrates how to install the 'rhombus' package using the 'raco' command-line tool, which is part of the Racket distribution. This step is necessary if you did not install a Racket snapshot that includes Rhombus. ```Shell raco pkg install rhombus ``` -------------------------------- ### Manual Koyo Console Setup (Racket) Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/koyo/console.html Demonstrates the manual steps required to initialize and start the Koyo console. This involves defining the path to the dynamic module, creating and setting a namespace, specifying components to stub, and finally invoking the start procedure with the defined path and namespace. ```Racket (define dynamic.rkt (build-path here "dynamic.rkt")) (define start-console) (define ns (make-base-empty-namespace)) (current-namespace ns) (koyo:stubbed-components '(server pubsub)) (koyo:start-console dynamic.rkt ns) ``` -------------------------------- ### Running a RackUnit Test Suite in Racket Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/rackunit/quick-start.html This snippet shows how to execute a defined RackUnit test suite. It requires the `rackunit/text-ui` module to get the `run-tests` function, which then runs the specified test suite (`file-tests`) and prints the results to the console. ```Racket (require rackunit/text-ui) (run-tests file-tests) ``` -------------------------------- ### Run Minimal Vulkan Example Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/vulkan/Setup.html Runs a basic Racket script that uses the Vulkan library to create and destroy an instance, confirming basic API interaction. ```Shell racket examples/minimal.rkt ``` -------------------------------- ### Example Usage of a Racket Component Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/component/index.html Demonstrates how to create an instance of the `mailer` component, check its initial state using the accessor `mailer-started?`, start the component using `component-start`, and verify the state change after starting. ```Racket ([define m (mailer #f)) (mailer-started? m) (mailer-started? ([component-start m)) ``` -------------------------------- ### Quickstart: Initialize Client and Capture Exception (Racket) Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/sentry/index.html This snippet demonstrates the basic usage of the Racket Sentry SDK. It shows how to install the library, create a Sentry client instance with a DSN, set the client as the current one using `parameterize`, capture a simple exception, and finally stop the client to ensure events are sent. ```Racket (require sentry) (define client (make-sentry "https://key@sentry.io/12")) (parameterize ([current-sentry client]) (sentry-capture-exception! (make-exn:fail "an error" (current-continuation-marks)))) (sentry-stop client) ``` -------------------------------- ### Basic Denxi Launcher (Racket) Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/denxi-guide/index.html Defines a minimal Denxi launcher program using `#lang denxi/launcher`. It includes a `module+` block for the `main` entry point, which calls `launch-denxi!` to start the Denxi process. ```Racket #lang denxi/launcher (module+ main (launch-denxi!)) ``` -------------------------------- ### Getting Start State in OpenFST (Racket) Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/openfst/index.html Returns the state identifier for the start state of the given fst. If the FST lacks a start state, either due to being empty or invalid, the procedure returns #false. ```Racket procedure (fst-start fst) → (or/c #f exact-nonnegative-integer?) ``` -------------------------------- ### Importing Dependencies for RackUnit Test File Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/rackunit/quick-start.html Sets up a Racket test file (`file-test.rkt`) by specifying the base language and importing the necessary libraries: `rackunit` for testing capabilities and the local file (`file.rkt`) containing the code to be tested. ```Racket #lang racket/base (require rackunit "file.rkt") ``` -------------------------------- ### Installing Racket-Mike from Remote Catalog (Raco) Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/mike/mike-about.html Installs the Racket-Mike package from the official Racket package catalog using the raco package manager. ```Shell raco pkg install mike ``` -------------------------------- ### Run Racket with Honu at REPL Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/honu/Get_started.html Invoke the Racket command-line interpreter with the '-Iq honu' flags to start an interactive REPL session using the Honu language. This allows for direct evaluation of Honu expressions. ```Shell racket -Iq honu ``` -------------------------------- ### Starting the Racket REPL (Shell) Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/more/index.html Command to launch the Racket interactive environment (REPL) from the command line. This allows users to execute Racket code directly and interactively. ```Shell $ racket ``` -------------------------------- ### Run Denxi Launcher with Install Command (Shell) Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/denxi-guide/index.html Executes the `my-denxi.rkt` launcher script using the `racket` interpreter. It passes the `do` command with `++install-abbreviated` and specifies `definition.rkt` as the target, demonstrating how to use the launcher from the command line. ```Shell $ racket my-denxi.rkt do ++install-abbreviated definition.rkt ``` -------------------------------- ### Get Help for Tiny BASIC Example Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/tinybasic/index.html Display command-line help specific to a Tiny BASIC example script, such as the Guess Number game. Use the `-- --help` syntax to pass the help flag to the example script itself. ```Shell racket -l tinybasic/examples/guess-number -- --help ``` -------------------------------- ### Initialize Frog Project Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/frog/Quick_start.html Runs the Frog initialization command to set up a new project directory, creating the necessary structure and the default frog.rkt configuration file. ```Shell raco frog --init ``` -------------------------------- ### Creating a Thing with Initial Procedures in Racket Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/qtops/things.html Illustrates how to provide a list of initial procedures when creating a 'thing' using `create-thing`, allowing the thing to respond to specific symbols immediately. ```Racket (define milkweed (create-thing "milkweed" (list (lambda (t) (list (cons 'pop (lambda () (printf "Pop!")))))))) ``` ```Racket (milkweed 'pop) ``` -------------------------------- ### Scribble Comment Syntax Examples Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/scribble/getting-started.html These examples demonstrate the two primary forms of comments in Scribble using the @; syntax: a block comment enclosed in braces and a line comment that runs to the end of the line. ```Scribble @;{ ‹comment› } @; ‹line-comment› ``` -------------------------------- ### Displaying Fitbit Client Command Line Help (Shell) Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/simple-oauth2/Example_Command_Line_Tools.html Shows how to display the help message for the `fitbit` command-line tool. Lists the available options, their short and long forms, and descriptions, including date range, units, format, and output file options. Useful for understanding tool usage. ```shell $ fitbit -h fitbit [ <option> ... ] <scope> where <option> is one of / -v, --verbose : Compile with verbose messages \ -V, --very-verbose : Compile with very verbose messages -s <start>, --start-date <start> : Start date (YYYY-MM-DD) -e <end>, --end-date <end> : End date (YYYY-MM-DD) -u <units>, --units <units> : Unit system (US, UK, metric) -f <format>, --format <format> : Output format (csv) -o <path>, --output-file <path> : Output file --help, -h : Show this help ``` -------------------------------- ### Install Racket Vulkan Package Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/vulkan/Setup.html Installs the Racket Vulkan package using the raco package manager for general users. ```Shell raco pkg install vulkan ``` -------------------------------- ### Run Tiny BASIC Example (Hello) Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/tinybasic/index.html Execute the classic Hello World example program included with the Tiny BASIC library. This is a simple test to ensure the environment is set up correctly. ```Shell racket -l tinybasic/examples/hello ``` -------------------------------- ### Installing Racket-Mike from Local Repository (Raco) Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/mike/mike-about.html Installs the Racket-Mike package from a locally cloned repository using the raco package manager, specifying the package name. ```Shell raco pkg install --name mike ``` -------------------------------- ### MongoDB Quickstart Example - Racket Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/mongodb/Quickstart.html This snippet demonstrates the basic workflow for interacting with MongoDB using the Racket library. It shows how to establish a connection, select a database, define a data structure similar to an ORM model using `define-mongo-struct`, create an instance of that structure, and perform simple updates like adding tags, incrementing views, and setting comments, finally retrieving a field. ```Racket ([define m ([create-mongo])) ([define d ([make-mongo-db m "awesome-dot-com"])) ([current-mongo-db d]) ([define-mongo-struct post "posts" ([title #:required] [body #:required] [tags #:set-add #:pull] [comments #:push #:pull] [views #:inc])) ([define p (make-post #:title "Welcome to my blog" #:body "This is my first entry, yay!")) (set-add-post-tags! p 'awesome) (inc-post-views! p) (set-post-comments! p ([list "Can't wait!" "Another blog?"])) (post-comments p) ``` -------------------------------- ### Start Racket Database Component with SQLite Connector Example Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/component/index.html Demonstrates how to create and start a database component using the `make-db` constructor and the `component-start` method. The example uses an anonymous function as the connector that establishes a temporary SQLite database connection. ```Racket (component-start (make-db (lambda () (sqlite3-connect #:database 'temporary)))) ``` -------------------------------- ### Download Qi Tutorial (Shell) Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/qi/Tutorial.html Uses the 'raco new' command, provided by Racket Templates, to download and set up the interactive Qi tutorial project files into a new directory. ```Shell raco new qi-tutorial ``` -------------------------------- ### Scribble Text-Mode Examples Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/scribble/getting-started.html This snippet shows various examples of the @ syntax in Scribble's text mode, demonstrating how to use commands with arguments ([...]), text bodies ({...}), or both, and how to include Racket forms directly. ```Scribble @([require] scriblib/figure) @[section][#:tag "poetry"]{Of Mice and Cookies} See @[secref]["milk"]. @[section][#:tag "milk"]{@[italic]{Important} Milk Supplies} @[figure]["straw" @[elem]{A straw}]{@[image]["straw.png"]} ``` -------------------------------- ### Install GStreamer Bad Plugins with RTMPDump and fdk-aac Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/overscan/getting-started.html Installs the 'bad' set of GStreamer plugins via Homebrew, including dependencies for RTMP streams (RTMPDump) and AAC audio encoding (Fraunhofer FDK AAC). ```Shell brew install gst-plugins-bad --with-rtmpdump --with-fdk-aac ``` -------------------------------- ### Using Absolute Labels and Operand Labels in Asi64 Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/asi64/index.html Provides an example of defining and using absolute labels (starting with `:`) and demonstrates an operand label (`b:`) for potential self-modifying code within an Asi64 block. ```6502 Assembly { :a lda :b @0 sta $d021 inc b: jmp a: } ``` -------------------------------- ### Build and Preview Darwin Project Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/darwin@darwin/Quick_start.html Builds the Darwin blog project and launches a local web server to preview the generated site. The '-bp' flag stands for build and preview. ```Shell raco darwin -bp ``` -------------------------------- ### Updating Frog and Dependencies with Raco Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/frog/Quick_start.html Updates the Frog package and all its installed dependencies to their latest versions using the Racket package manager, raco. ```Shell $ raco pkg update --update-deps frog ``` -------------------------------- ### Show Livongo Client Help Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/simple-oauth2/Example_Command_Line_Tools.html Displays the help message and usage information for the `livongo` command-line tool. ```shell $ livongo -h ``` -------------------------------- ### Creating a New Project Directory Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/frog/Quick_start.html Creates a new subdirectory in the current location. This directory will serve as the root for the new Frog blog project. ```Shell $ mkdir frog-project ``` -------------------------------- ### Building Racket with Specific Setup Options (Shell) Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/raco/running.html This command demonstrates how to pass options to raco setup during the make install process by setting the PLT_SETUP_OPTIONS environment variable. In this specific example, it sets the -j 1 flag, which limits the number of parallel processes used for building collections to one. ```Shell make install PLT_SETUP_OPTIONS="-j 1" ``` -------------------------------- ### Launching Web UI for Acronym Function (Racket) Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/racketui/Quick_Start.html Uses the `web-launch` function from the `racketui` package to create and launch a web interface for the `acronym` function. It specifies the application title, a description for the input field, the function to wrap (`acronym`), and the input/output contract. ```Racket (web-launch "Acronym Builder" (function "Enter some words to build an acronym." (acronym ["Words" (listof+ ["Word" string+])] [-> ["The acronym" string]]))) ``` -------------------------------- ### Configure Racket Setup: avoid-main-installation Parameter Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/raco/setup-plt-plt.html This parameter influences whether the Racket setup process avoids installation into the main Racket installation directory. Accessing the parameter returns its current boolean state, and setting it changes this state. The default is #t (to avoid main installation, implying installation elsewhere, perhaps user-specific). ```Racket parameter (avoid-main-installation) → boolean? (avoid-main-installation on?) → void? on? : any/c ``` -------------------------------- ### Initializing Frog Project with Default Files Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/frog/Quick_start.html Runs the Frog initialization command within the project directory. This command creates the basic file structure, configuration file (frog.rkt), and default templates/posts. ```Shell $ raco frog --init Creating files in /tmp/frog-project/: /tmp/frog-project/frog.rkt /tmp/frog-project/_src/About.md /tmp/frog-project/_src/page-template.html /tmp/frog-project/_src/post-template.html /tmp/frog-project/_src/posts/2012-01-01-a-2012-blog-post.md /tmp/frog-project/css/ /tmp/frog-project/js/ /tmp/frog-project/img/ Project ready. Try \`raco frog -bp\` to build and preview. ``` -------------------------------- ### Limiting raco setup to Installation Layer Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/raco/layered-install.html The '--no-user' argument for 'raco setup' restricts its operations to only the main installation layer, preventing modifications to the user-specific layer. ```Racket raco setup --no-user ``` -------------------------------- ### Initialize New Darwin Project Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/darwin@darwin/Quick_start.html Initializes a new Darwin blog project in the current directory. This command creates the default file structure and configuration files required for a Darwin blog. ```Shell raco darwin --init ``` -------------------------------- ### Creating a Racket Array Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/math/array_quick.html Shows an example of a 2D Racket array literal, representing the initial array used in subsequent examples. ```Racket (array #[#[0 2 4 6 8] #[2 4 6 8 10] #[4 6 8 10 12] #[6 8 10 12 14]]) ``` -------------------------------- ### Limiting raco setup to User Layer Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/raco/layered-install.html The '--avoid-main' argument for 'raco setup' restricts its operations to only the user-specific installation layer, preventing modifications to the main installation layer. ```Racket raco setup --avoid-main ``` -------------------------------- ### Defining the Dispatch Table and Hello Handler Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/more/step6.txt Initializes a hash table (`dispatch-table`) used to map URL path components to handler functions. Sets up a basic handler for the path "hello" that returns a simple "Hello, World!" HTML page. ```Racket (define dispatch-table (make-hash)) (hash-set! dispatch-table "hello" (lambda (query) `(html (body "Hello, World!")))) ``` -------------------------------- ### Importing libraries for example (Racket) Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/semaphore-utils/index.html Imports the `racket/splicing` and `semaphore-utils` libraries as shown in an example context, typically done at the start of a Racket file. ```Racket (require racket/splicing semaphore-utils) ``` -------------------------------- ### Complete Racket Package Setup (Racket) Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/dynamic-ffi/index.html Runs the raco setup command to finalize the installation and build process for the dynamic-ffi package after all external dependencies have been successfully installed. ```Racket raco setup -p -D dynamic-ffi ``` -------------------------------- ### Managing Racket Layers with raco setup Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/raco/layered-install.html The 'raco setup' command is used to update Racket installations and packages. By default, it attempts to update both the installation and user layers, which requires write permissions for the installation layer. Options can constrain its actions. ```Racket raco setup ``` -------------------------------- ### Serving Racket Servlet Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/piecrust/index.html This Racket code demonstrates how to start a web server using serve/servlet, directing incoming requests to an API dispatcher (api-dispatcher items-api). It configures the servlet to handle all request paths ("" and "/") and prevents the automatic launching of a web browser upon startup. ```Racket (serve/servlet (api-dispatcher items-api) #:servlet-regexp #rx"" #:servlet-path "/" #:launch-browser? #f) ``` -------------------------------- ### Create New Project Directory Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/darwin@darwin/Quick_start.html Creates a new subdirectory named 'darwin-project' in the current location. This directory will serve as the root for the new Darwin blog project. ```Shell mkdir darwin-project ``` -------------------------------- ### Define Module Path Racket Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/pollen/Setup.html Defines the variable `my-installed-mod` by resolving the module path `'package/my-other-module` using `resolve-module-path`. This is typically used to get the path to a module installed as part of a package. ```Racket ([define my-installed-mod ([resolve-module-path 'package/my-other-module))]) ``` -------------------------------- ### Calling the setup procedure in Racket Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/raco/setup-plt-plt.html This Racket procedure performs various setup tasks for Racket, including compiling files, installing collections and packages, generating documentation, and managing dependencies. It accepts numerous keyword arguments to control the setup process and returns a boolean indicating success. ```Racket (setup #:file file #:collections collections #:pkgs pkgs #:planet-specs planet-specs #:make-user? make-user? #:avoid-main? avoid-main? #:make-docs? make-docs? #:make-doc-index? make-doc-index? #:force-user-docs? force-user-docs? #:check-pkg-deps? check-pkg-deps? #:fix-pkg-deps? fix-pkg-deps? #:unused-pkg-deps? unused-pkg-deps? #:clean? clean? #:tidy? tidy? #:recompile-only? recompile-only? #:jobs jobs #:fail-fast? fail-fast? #:get-target-dir get-target-dir) ``` -------------------------------- ### Installing a single Racket package with raco Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/req/req-tutorial.html Demonstrates the standard command-line method for installing a single local Racket package using the `raco pkg install` command, highlighting its verbosity compared to using Req. ```Racket raco pkg install --no-docs --skip-installed ./src/mypkg-lib ``` -------------------------------- ### Rebuilding Pollen-rock Package (Shell) Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/pollen-rock/dev.html If you encounter cache issues after installing the package locally, run this command to rebuild the Pollen-rock package using `raco setup -l`. This can help resolve dependency or linking problems. ```shell $ raco setup -l pollen-rock ``` -------------------------------- ### Equivalent Racket-Mode Expansion Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/scribble/getting-started.html This snippet shows the Racket code equivalent to the Scribble text-mode examples. It illustrates how @ commands with arguments and text bodies are expanded into Racket function calls and how text content becomes string literals. ```Racket ([require] scriblib/figure) "\n" "\n" ([section] #:tag "poetry" "Of Mice and Cookies") "\n" "See " ([secref] "milk") "." "\n" "\n" ([section] #:tag "milk" ([italic] "Important") " Milk Supplies") "\n" ([figure] "straw" ([elem] "A straw") ([image] "straw.png")) "\n" ``` -------------------------------- ### Starting Pollen Project Server (Shell) Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/pollen/quick-tour.html Navigate to your Pollen project directory and start the project server using the `raco pollen start` command. This launches a local web server that serves your project files and dynamically renders Pollen source files. ```Shell cd /directory/containing/your/hello-file raco pollen start ``` -------------------------------- ### Converting X-expression to HTML String (Racket) Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/more/index.html This example demonstrates the usage of the `xexpr->string` function from the `xml` library. It takes a Racket x-expression representing an HTML structure and converts it into a standard HTML string. ```Racket (xexpr->string '(html (head (title "Hello")) (body "Hi!"))) ``` -------------------------------- ### Starting a Racket TCP Server Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/more/step6.txt Initializes a TCP listener on the specified port and starts a background thread to continuously accept and handle incoming connections. Uses a custodian to manage resources associated with the server. ```Racket (define (serve port-no) (define main-cust (make-custodian)) (parameterize ([current-custodian main-cust]) (define listener (tcp-listen port-no 5 #t)) (define (loop) (accept-and-handle listener) (loop)) (thread loop)) (lambda () (custodian-shutdown-all main-cust))) ``` -------------------------------- ### Starting Pollen Project Server (Shell) Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/pollen/first-tutorial.html Commands required to navigate to the project directory and initiate the Pollen web server, making the project dashboard accessible via a web browser. ```Shell cd /path/to/tutorial ``` ```Shell raco pollen start ``` -------------------------------- ### Defining Constants/Variables in Asi64 6502 Block Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/asi64/index.html Shows the shorthand syntax `name = value` for defining constants or variables within an Asi64 6502 block, providing examples with hexadecimal, binary, and a list value. ```6502 Assembly { a = $42 b = %0000_1111 c = (list 1 $2 %11) } ``` -------------------------------- ### Adding Flonums with my-fl+ in Racket Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/x64asm/Getting_Started.html This example demonstrates calling a function named 'my-fl+' with two floating-point numbers (Flonums), 100.0 and 200.0. The context indicates the expected output is 300.0, suggesting it performs floating-point addition. ```Racket (my-fl+ 100.0 200.0) ``` -------------------------------- ### Generating PDF Output with Scribble (Command Line) Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/scribble/getting-started.html This command uses the `--pdf` flag to generate a PDF document from a Scribble source file. This requires `pdflatex` to be installed on the system. The output is saved as a file with a `.pdf` extension. ```Shell scribble --pdf mouse.scrbl ``` -------------------------------- ### Navigating into Project Directory Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/frog/Quick_start.html Changes the current working directory to the newly created project directory, preparing for the next steps of project initialization. ```Shell $ cd frog-project ``` -------------------------------- ### Define Variables and Function Start for Web Testing Example - Racket Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/web-server/test.html This snippet shows the beginning of a Racket code example for testing a web application. It defines a function `test-add-two-numbers` (partially shown), a random integer `x`, and a byte string `xs` derived from `x`. This setup likely precedes the actual use of a tester function to simulate requests. ```Racket (define (test-add-two-numbers -s>) (define x (random 500)) (define xs (string->bytes/utf-8 (number->string x))) ``` -------------------------------- ### Using the Specific Character Parser char/p in Racket Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/megaparsack/parsing-basics.html Shows how to use the `char/p` function to create a parser that matches a specific character. Includes examples of both successful parsing and a parse error when the input doesn't match the expected character. ```Racket (parse-string (char/p #\a) "abc") ``` ```Racket (parse-result! (parse-string (char/p #\a) "xyz")) ``` -------------------------------- ### GET /rest/fs/$path - Read File Example (curl) Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/pollen-rock/server-spec.html Example `curl` command demonstrating how to read the contents of the file 'dir1/file3.html.pm' using the GET /rest/fs/$path endpoint. ```bash curl http://localhost:8000/rest/fs/dir1/file3.html.pm ``` -------------------------------- ### Creating and Initializing a Racket GUI Frame Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/quick/index.html This snippet demonstrates how to load the necessary libraries (`racket/class`, `racket/gui/base`) and create a new instance of the `frame%` class, initializing it with properties like label, dimensions, and alignment. ```Racket (require racket/class racket/gui/base) (define f (new frame% [label \"My Art\"] [width 300] [height 300] [alignment '(center center)])) ``` -------------------------------- ### Defining txexprs for Attribute Order Test (check-equal?) Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/txexpr/index.html Defines the same two `txexpr` values, `tx1` and `tx2`, as in the previous example. This setup is presented as a starting point for demonstrating how `check-equal?` would behave differently (failing because attribute order matters for `equal?`). ```Racket (define tx1 '(div ((attr-a "foo")(attr-z "bar")))) (define tx2 '(div ((attr-z "bar")(attr-a "foo")))) ``` -------------------------------- ### Creating a new ps-setup% object (Racket) Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/draw/ps-setup_.html Creates a new instance of the ps-setup% class with the platform-specific default configuration. ```Racket (new ps-setup%) ``` -------------------------------- ### Using Title and Abstract with ACM Style (Racket/Scribble) Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/scribble/getting-started.html This example demonstrates how to use the @title and @abstract forms, which are available when the document language is set to scribble/acmart. These forms structure the document's introductory content, appearing as an inset paragraph in HTML output. ```Racket #lang scribble/acmart @title{On the Cookie-Eating Habits of Mice} @abstract{If you give a mouse a cookie, he's going to ask for a glass of milk.} @section{The Consequences of Milk} .... ``` -------------------------------- ### Call 'start' Label (Racket) Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/x64asm/Getting_Started.html Calls the procedure starting at the label `start` again. This is the second recursive call. `rel32` indicates a 32-bit relative call offset. ```Racket ([call] ([rel32] start)) ``` -------------------------------- ### Providing Definitions from a Racket Module Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/quick/index.html Shows how to use the `provide` form within a module (like 'quick.rkt') to explicitly make specific definitions (here, `rainbow` and `square`) available for other modules to import. ```Racket (provide rainbow square) ``` -------------------------------- ### Starting Rilouworld Engine Client (Racket) Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/rilouworld/Overview.html This code block demonstrates how to start the Rilouworld game engine as a client. It calls `engine-start` with options (`engine-options` for window size and title), loads a specific world file (`load-quest`), and logs in an account (`account`). ```Racket (engine-start (engine-options 512 384 "Rilouworld") (load-quest "worlds/ma/index.world") (account "EuhMeuh" 'supa)) ``` -------------------------------- ### GET /rest/fs/$path - List Root Directory Example (curl) Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/pollen-rock/server-spec.html Example `curl` command demonstrating how to list the contents of the project root directory using the GET /rest/fs/$path endpoint. ```bash curl http://localhost:8000/rest/fs/ ``` -------------------------------- ### Broadcast Test Stream with Overscan (Racket) Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/overscan/getting-started.html This snippet demonstrates the basic 'Hello, world' of Overscan by initiating a test broadcast. It uses `videotestsrc` for video, `audiotestsrc` for audio, and `filesink` to output the combined stream to `/dev/null`. This also typically opens a preview window and plays the audio. ```Racket (#lang overscan) (broadcast (videotestsrc) (audiotestsrc) (filesink "/dev/null")) ``` -------------------------------- ### Inserting Binary Data with data Macro (Racket) Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/asi64/index.html Demonstrates the use of the `data` macro to insert binary data. It shows how the macro handles lists recursively and includes an example generating a list of byte values representing a sine wave. ```Racket [define (deg->rad rad) [* (/ pi 180) rad)] :sine (data [for/list ([x [in-range 0 365 5)]) [bitwise-and [exact-round [* [sin (deg->rad x)] 100)] 255]]) ``` -------------------------------- ### Get Multidict Unique Values Example (Input) - Racket Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/rebellion/Multidicts.html Shows an example call to the `multidict-unique-values` procedure using the same superhero multidict as the `multidict-values` example. This is the input multidict for this example. ```Racket (multidict-unique-values (multidict "Iron Man" 'marvel "Superman" 'dc "The Black Panther" 'marvel "Wonder Woman" 'dc "The Hulk" 'marvel "Captain Marvel" 'marvel)) ``` -------------------------------- ### Loading and Running a Racket Module in REPL (Racket) Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/more/index.html Demonstrates how to load a Racket module file (`serve.rkt`) into the interactive REPL using `enter!`, and then execute a function (`go`) defined within that module. Includes the REPL prompt `>`. ```Racket > (enter! "serve.rkt") > (go) ``` -------------------------------- ### Launching Racket-Mike with Racket --lib (Help) Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/mike/mike-about.html Launches the Racket-Mike main module using the Racket interpreter with the --lib flag, passing the -h argument to display help. ```Shell racket -l mike/main -- -h ``` -------------------------------- ### Configure Scriblogify for automatic posting Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/scriblogify/index.html Run the setup process for Scriblogify's automatic posting feature. This command starts a local configuration servlet and opens a browser window to guide the user through granting access to Blogger and optional Picasa Web accounts. ```Shell raco scriblogify --setup ``` -------------------------------- ### Installing Racket-Mike Executable to PATH (Shell) Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/mike/mike-about.html Copies the generated Racket-Mike executable binary to a directory typically included in the system's PATH, requiring superuser privileges. ```Shell sudo cp ./bin/mike /usr/bin ``` -------------------------------- ### Using do-times for Fixed Iteration (Racket) Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/kb-base/Getting_Started_with_Keybindings.html This snippet demonstrates the basic usage of the `do-times` form. It executes the body expression (inserting the character "a") a fixed number of times (10). The example shows the expected output after running this keybinding program. ```Racket (test-kb-program (do-times 10 (insert "a"))) ``` -------------------------------- ### Call 'start' Label (Racket) Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/x64asm/Getting_Started.html Calls the procedure starting at the label `start`. This pushes the return address onto the stack and jumps to `start`. `rel32` indicates a 32-bit relative call offset. This suggests a recursive call. ```Racket ([call] ([rel32] start)) ``` -------------------------------- ### Executing Raqet Source File with Racket Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/raqet/installation.html Shows the command to execute a Raqet program stored in a text file (e.g., `hello.q`) using the main `racket` executable. The `#lang qing` line inside the file tells Racket how to process the code. ```Shell $ racket hello.q ``` -------------------------------- ### Install Pollen Package (raco pkg) - Shell Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/pollen/first-tutorial.html Installs the Pollen package using Racket's command-line utility, `raco`. The `pkg install` subcommand manages package installations. ```shell raco pkg install pollen ``` -------------------------------- ### Initialize User Tethered Layer with raco setup Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/raco/tethered-install.html Initializes a user-specific tethered Racket installation layer. This command sets up the necessary wrapper executables in the directories specified in the 'addon-dir'/etc/config.rktd file, avoiding the main setup process. ```Shell racket -A ‹addon-dir› -l- raco setup --avoid-main ``` -------------------------------- ### Querying Fitbit Weight Data via Command Line (Shell) Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/simple-oauth2/Example_Command_Line_Tools.html Illustrates querying Fitbit weight data for the current date using the `-f screen` flag to format the output as a table on the console. Displays the expected table structure with date, time, weight, BMI, and fat percentage. Requires the client to be authorized. ```shell $ fitbit -f screen weight ┌───────────┬──────────┬────────┬───────┬──────────────────┐ │date │ time │ weight │ bmi │ fat │ ├───────────┼──────────┼────────┼───────┼──────────────────┤ │2019-02-05 │ 15:04:16 │ 262.2 │ 35.59 │ 39.25299835205078│ └───────────┴──────────┴────────┴───────┴──────────────────┘ ``` -------------------------------- ### Define Assembly Label 'start' (Racket) Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/x64asm/Getting_Started.html Defines a label named `start` in the assembly code. Labels are used as targets for jump or call instructions. ```Racket ([:!] start) ``` -------------------------------- ### Getting Range Start Point in Rhombus Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/rhombus-reference/Ranges.html Returns the starting point of the given range `rge`. The starting point can be #neginf, which indicates that the range has no explicit lower bound. ```Rhombus (rge :: Range).start() ``` -------------------------------- ### Getting Default Continuation Prompt Tag Racket Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/reference/cont.html Returns the constant default prompt tag. A prompt with this tag is installed at the start of every thread's continuation. Its initial handler accepts any number of values and returns. This tag is the default for any procedure that accepts a prompt tag. ```Racket ([default-continuation-prompt-tag](#%28def._%28%28quote._~23~25kernel%29._default-continuation-prompt-tag%29%29) → continuation-prompt-tag?) ``` -------------------------------- ### Basic MQTT Client Usage - Racket Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/mqtt-client/index.html This snippet demonstrates the fundamental steps for interacting with an MQTT broker using the Racket mqtt-client library. It shows how to establish a client and connection, set the publishing QOS, subscribe to a topic, publish a message, and receive and display an incoming message using nested context forms. ```Racket #lang racket/base (require mqtt-client) (mqtt/with-client ("localhost" "client1") (mqtt/with-connection (#:keep-alive-interval 20 #:clean-session #t) (mqtt/with-qos ('qos-1) (mqtt/subscribe "some-topic") (mqtt/publish "some-topic" "Hello world") (mqtt/with-message-recv (topic payload) (displayln topic) (displayln payload))))) ``` -------------------------------- ### Using the Defined mov Pseudo-Op in C64 Assembly Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/asi64/index.html Demonstrates calling the `mov` pseudo-op defined by `define-op` within a `C64` assembly block. It shows examples with immediate (`@42`), absolute (`$2000`), and zero-page (`$20`) addressing modes, highlighting how the macro handles them automatically. ```Assembly (C64 { *=$1000 (mov @42 $20) (mov $2000 $20) (mov $20 $2000) }) ``` -------------------------------- ### Starting Racket Handin Server (Shell) Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/handin-server/Quick_Start_for_a_Test_Drive.html This command is used to start the Racket Handin Server from the command line. It loads the 'handin-server' collection. ```Shell racket -l handin-server ``` -------------------------------- ### Installing Denxi Package (Shell) Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/denxi-guide/index.html Uses the raco package manager to install the Denxi package into the Racket environment. ```Shell raco pkg install denxi ``` -------------------------------- ### Setup Target Racket Installation for iOS Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/inside/ios-cross-compilation.html Uses the cross-compiling Racket executable to run `raco setup` for the target iOS installation. This command configures the target Racket environment based on the specified paths and cross-compilation settings. ```Command Line racket \ --compile-any \ --compiled ‹ios-racket-dir›/src/build/cs/c/compiled: \ --cross \ --cross-compiler tarm64osx ‹ios-racket-dir›/lib \ --config ‹ios-racket-dir›/etc \ --collects ‹ios-racket-dir›/collects \ -l- \ raco setup ``` -------------------------------- ### Importing Modules with require Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/quick/quick.scrbl Explains how to import external libraries or modules using the `require` form. Demonstrates importing the `pict/flash` module and using the `filled-flash` function it provides. ```Racket (require pict/flash) (filled-flash 40 30) ``` -------------------------------- ### Running Single Installer (Racket) Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/raco/_plt-archives.html Executes a single installer file in a separate thread and namespace. It manages the thread with a custodian and handles termination. It takes the installer file path, a procedure to get the installation directory, and an optional flag to show the beginning of the file on failure. ```Racket (run-single-installer file get-dir-proc #:show-beginning-of-file? show-beginning-of-file?) ``` -------------------------------- ### Initializing Web Server with Web Cells in Racket Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/web-server/servlet.html This Racket code snippet demonstrates the initial setup for a web server instance using `#lang web-server/insta`. It defines the main `start` procedure, which is the entry point for handling requests. Inside `start`, it initializes two variables, `counter1` and `counter2`, by calling a `make-counter` procedure, illustrating the context where Web cells might be used. ```Racket #lang web-server/insta (define (start initial-request) (define counter1 (make-counter)) (define counter2 (make-counter)) ``` -------------------------------- ### Configuring Emulator with Helper Function - Racket Source: https://docs.racket-lang.org/docs_racket-lang_org_markdown/asi64/index.html Defines a convenience function `configure-emu` that takes multiple parameters and sets the corresponding fields of the global `emu` struct instance in a single call. The last line seems like a leftover or example usage, setting `execute?` to `#f` again. ```Racket ([define (configure-emu emu-path program-path execute-emu? enable-breakpoints?) (set-emulator-program! emu program-path) (set-emulator-execute?! emu execute-emu?) (set-emulator-breakpoints?! emu enable-breakpoints?) (set-emulator-path! emu emu-path)) (set-emulator-execute? emu #f) ```