ALMFCPLIR

From Esolang
Jump to navigation Jump to search
This is still a work in progress. It may be changed in the future.

ALMFCPLIR (or A Langauge Made For making Cambridge Programming Language Into Reality) is a language with the sole purpose is for making CPL (the true first C) more popular (since acording to Wikipedia: The implementation did exist in 1970's, but the langauage never got popularity so it disappeared in the same decade), however this idea turned into a sort of *python-like language.

This is also the first time User:Ractangle actually took the advice from User:Ais523 on firstly planing the esolang and then writing the page about (although kinda)

Syntax

The langauge's syntax will be denoted from the "max" function found from the Wikipedia article:

Max(Items, ValueFunction) = value of
§ (Best, BestVal) = (NIL, -∞)
while Items do §
(Item, Val) = (Head(Items), ValueFunction(Head(Items)))
if Val > BestVal then (Best, BestVal) := (Item, Val)
Items := Rest(Items) ̸§
result is Best ̸§

Functions

The way you define "Standard" functions is slightly similar to Javascript defining one-liner functions:

f(p1, p2) > [...]

There are also other types of functions:

["Void" functions don't have arguments]
{void} = {f > [...]}

["Class" functions are "standard" functions but use other functions inside them (which can be used in code)]
f(p1, p2) > [e(p1) > [...]]
f.e(1)

Variables

Varibles are defined in the same way as you define a "Void" function (which allows you to define many variables with the same value):

{n1,n2} > {0}

"Hello, world!" program

{p} > {"Hello, world!"}