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/if: IF extends ZERO with conditional expressions, using Boolean values to choose which branch to evaluate.

BranchesTags
Open more actions menu

Latest commit

 

History

15 Commits
15 Commits

Folders and files

NameName
Last commit message
Last commit date
docs
docs
 
 
src/IF
src/IF
 
 
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

IF

IF extends ZERO with conditional expressions:

if zero?(0) then 2 else 3

A conditional evaluates its condition first, then uses the resulting Boolean value to choose which branch to evaluate. The other branch remains unevaluated.

That means this program succeeds:

if zero?(0) then 2 else -(zero?(0), 1)

even though the else branch would produce a runtime type error if it were evaluated.

For a closer look, read IF: Conditional Expressions and Selective Evaluation.

Try it

You'll need Nix with flakes enabled.

nix develop
elm repl

Then:

import IF.Interpreter as I

I.run "if zero?(0) then 2 else 3"
-- Ok (VNumber 2)

About

IF extends ZERO with conditional expressions, using Boolean values to choose which branch to evaluate.

blog.tinyinterpreters.dev/posts/if/

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.