Skip to content

pointfree interpreter with instance variables and classes, in lazarus

Notifications You must be signed in to change notification settings

metazip/pointfrip

Repository files navigation

pointfrip

pointfree interpreter with instance variables and classes, in lazarus

screenshot

Function-level Programming like FP from John Backus

ip ≡ (+ \) ° (* aa) ° trans ° ee
eq0  ≡ id=0
sub1 ≡ id-1
fact ≡ eq0 → 1; id*fact°sub1

for example: generation of numbers with iota

iota == [1]°((ispos°[0])->*(pred°[0]),([0],[1]),)°id,(),
iota ° 10
--> (1 ; 2 ; 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 ; 10 ;)

possibility to work with tables/instance-variables like in trivia

(#beta & #alpha & #gamma & #delta & "US") ° (delta:="K") ° '("A" alpha "B" beta "C" gamma)
--> "BACKUS"

defining classes and using objects

constr == .. { object
               [head] == head ° pop
               [tail] == tail dip
               [comma] == (top°[0]) obj [1],pop°[0]
               [reverse] == reverse dip  // method
             }
--> ( )

reverse ° (constr :: A;B;C;)             // reverse == [reverse] fn ...
--> (constr :: C ; B ; A ;)

side-effects used in installer.exe

((#draco loadtext)°(draco:=corepath & "drache.pf") eff 'io)>>(it showinfo)>>(#draco run)>>()

meta-programming: you can also create your own combining forms like in Backus FFP

quoteit == top°term

(a quoteit)
--> a

twice == (top°term) app (top°term) app arg

((id+1) twice) ° 5
--> 7

while == ((top°term) app arg)->(term app (pop°term) app arg);arg

head°((isprop°tail) while tail) ° (a;b;c;d;e;)
--> e

Limited API support: httpget and parsejson for reading APIs. (Version-20240701)

Example
Reference.pdf
Quickinfo.pdf
Website


heise Download
Virus checked with 40 virus scanners from heise.de
If you like pointfrip you can download and use it.

friedbrice

This is a Red and λ-Red language: Closed applicative languages