Skip to content
Snippets Groups Projects
Select Git revision
  • main default protected
  • inlining-off
  • inlining-more
3 results

prescheme-demo

  • Clone with SSH
  • Clone with HTTPS
  • Andrew Whatson's avatar
    Andrew Whatson authored
     - add a guix manifest.scm to prepare the build environment
     - add a scheme48-prescheme guix package (to be upstreamed soon)
     - simplify the Makefile with pkg-config and implicit rules
    1426f12b
    History

    Pre-Scheme Demo Code

    This repository contains some basic examples of Pre-Scheme code, and a simple Makefile for compiling these into native executables.

    These examples are based on the one provided in “The Nearly Complete Scheme48 PreScheme Reference Manual” by Taylor Campbell: https://groups.scheme.org/prescheme/1.3/

    Source files

    • packages.scm - package definitions
    • lib/ps-string.scm - string utility functions
    • lib/ps-vector.scm - vector functions based on SRFI-43
    • hello.scm - “Hello World” in Pre-Scheme, from the manual
    • append.scm - Yes, you can string-append in Pre-Scheme
    • vecfun.scm - Showing off Pre-Scheme polymorphism with vectors

    The generated C for each of the demo programs is also included, so you can review the code generation without needing to build anything.

    How to build

    The Guix manifest sets up all prerequisites for building the demos, and compilation is handled by the Makefile.

    To build the demos yourself:

    git clone https://gitlab.com/flatwhatson/prescheme-demo.git
    cd prescheme-demo
    guix shell -m manifest.scm
    make
    

    License

    This code is licensed under BSD-3-Clause, the same as Scheme 48 and the Pre-Scheme compiler. See COPYING for details.