Refer

From Esolang
Jump to navigation Jump to search

Refer is a programming language that uses referring instead of variables

Normal

Print

print "hello"
printl "hello" #adds a newline

Noprint

noprint "hello" #does not print

Comments

#its obvious
#these are comments
#they tell whats happening in the code

Multiline

#*
hello
yay
i can type anything
*#

Lambda

(a:a) "hi" #hi
(a:a a)(a: a a) #Ω combinator

Non-Normal

This

refer to the current calculation

print this #max stack size exceeded

That

refer to the previous calculation

(a:a)
that "hi" #hi
print "hi" #hi
print that #hi, no error because of printing print, print is identity function, and when you just have expressions just there, no statements
#it puts it into output

Extension

chaining "that"s

(a:a)
noprint that
noprint that
noprint that
noprint that
that "hi" #hi

The one <n> line(s) ago

refer to one of the ones in the past

(a:a)
print "hi" #hi
print "yay" #yay
print "ok" #ok
(the one 4 lines ago) "hi" #hi

MORE Non-Normal

The next one

refer to the next calculation

print the next one #hi
noprint "hi"

Future extension

chaining the next ones

print the next one #hi
noprint the next one
noprint the next one
noprint the next one
noprint the next one
noprint "hi"

The one <n> lines later

refer to one of the ones in the future

print the one 5 lines later #hi
#nothing
#ok
#yeah
#fine
noprint "hi"

Goto

you can use goto to goto the reference

print "hi" #hi
goto that #goes back to the previous one

LESS NORMAL

A paradox

noprint the next one
noprint that

NOTE

the lines are kind of variables

noprint "hi" #effectivly store "hi" in line one
print that #refers to the value in the previous line