Front Page All Articles Recent Changes Random Article

Contents

Concatenative language

  • ACL
  • Ait
  • Aocla
  • Breeze
  • Callisto
  • Cat
  • Cognate
  • colorForth
  • Concata
  • CoSy
  • Deque
  • DSSP
  • dt
  • Elymas
  • Enchilada
  • ETAC
  • F
  • Factor
  • Fiveth
  • Forth
  • Fourth
  • Freelang
  • Gershwin
  • hex
  • iNet
  • Joy
  • Joy of Postfix App
  • kcats
  • Kitten
  • lang5
  • Listack
  • LSE64
  • Lviv
  • Meow5
  • min
  • Mirth
  • mjoy
  • Mlatu
  • Ode
  • OForth
  • Om
  • Onyx
  • Plorth
  • Popr
  • Porth
  • PostScript
  • Prowl
  • Quest32
  • Quackery
  • r3
  • Raven
  • Retro
  • RPL
  • SPL
  • Staapl
  • Stabel
  • Tal
  • Titan
  • Trith
  • Uiua
  • Worst
  • xs
  • XY
  • 5th
  • 8th

Concatenative topics

  • Compilers
  • Interpreters
  • Type systems
  • Object systems
  • Quotations
  • Variables
  • Garbage collection
  • Example programs

Concatenative meta

  • People
  • Communities

Other languages

  • APL
  • C++
  • Erlang
  • FP trivia
  • Haskell
  • Io
  • Java
  • JavaScript
  • Lisp
  • ML
  • Oberon
  • RPL
  • Self
  • Slate
  • Smalltalk

Meta

  • Search
  • Farkup wiki format
  • Etiquette
  • Sandbox

FP trivia

is a point-free programming language with instance variables

FP trivia is a pure functional programming language inspired by the FP-Systems of John Backus, APL, Smalltalk and Lisp. It is intended to remedy the problematic fact that FP[1] is viewed as free of variables, which is also true in terms of lambda variables, but not in terms of the instance variables that are used by FP trivia. The main data type is therefore a table that the instance variables can access and also allowes the infix notation which is mostly right-associative.

Syntax

A table is a linear arrangement of key-value pairs similar to a linked list.

  ( value0 key0 value1 key1 value2 key2 ... ... valuen keyn )  

An instance variable can then access a certain key and pick out the associated value.

  #key1 : (value0 key0 value1 key1 value2 key2 ... ... valuen keyn)
  --> value1  

In the original FP by John Backus, it was only possible to access values in a sequence using numbers as selectors. This is still possible via integer numbers[] on the values in the table.

  [2] : (value0 key0 value1 key1 value2 key2 ... ... valuen keyn)
  --> value2  

So you can define a function that adds three numbers.

  triadd == (#a + #b + #c) <- a;b;c;
   
  triadd ° 10,20,30,
  --> 60  

more code examples

References

[1] Can programming be liberated from the von Neumann style?: A functional style and its algebra of programs

External resource:

  • Link to FP trivia strict Repo and
  • FP trivia as Download (Reference in English/German)
  • Website of FP trivia

http://fpstefan.github.io/fpstefande/triviastrictmap.png

This revision created on Tue, 22 Dec 2020 01:55:52 by fpstefan

Latest Revisions Edit

All content is © 2008-2024 by its respective authors. By adding content to this wiki, you agree to release it under the BSD license.