GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - tinyinterpreters/let: LET extends VAR with let expressions, allowing programs to introduce local bindings with their own scope.

BranchesTags
Open more actions menu

Latest commit

 

History

12 Commits
12 Commits

Folders and files

NameName
Last commit message
Last commit date
docs
docs
 
 
src/LET
src/LET
 
 
tests/Test
tests/Test
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
elm.json
elm.json
 
 
flake.lock
flake.lock
 
 
flake.nix
flake.nix
 
 

Repository files navigation

LET

LET extends VAR with let expressions:

let a = 5 in -(a, 3)

A let expression evaluates the bound expression first, then binds its resulting value to a name while evaluating the body:

let a = 5 in -(a, 3)
-> VNumber 2

The binding's scope is the body. This means an inner let can shadow an outer binding:

let a = 5 in -(let a = 3 in a, a)
-> VNumber -2

The inner body sees a = 3, while the second operand still sees the outer a = 5.

For a closer look, read LET: Introducing Local Bindings and Scope.

Try it

You'll need Nix with flakes enabled.

nix develop
elm repl

Then:

import LET.Interpreter as I

I.run "let a = 5 in -(a, 3)"
-- Ok (VNumber 2)

I.run "let a = 5 in -(let a = 3 in a, a)"
-- Ok (VNumber -2)

About

LET extends VAR with let expressions, allowing programs to introduce local bindings with their own scope.

blog.tinyinterpreters.dev/posts/let/

Resources

Readme
BSD-3-Clause license
Activity
Custom properties

Stars

1 star

Watchers

0 watching

Forks

0 forks
Report repository

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.