Questions Concepts
GitHub icon

Arc

Arc - Programming language

< >

Arc is a programming language created in 2001 by Paul Graham and Robert Morris.

#244on PLDB 22Years Old 236Repos

Try now: Web

Arc is a dialect of the Lisp programming language developed by Paul Graham and Robert Morris.. Read more on Wikipedia...


Example from hello-world:
(prn "Hello World")
Example from Wikipedia:
(defop said req (aform [onlink "click here" (pr "you said: " (arg _ "foo"))] (input "foo") (submit)))

Language features

Feature Supported Token Example
Strings "
"Hello world"
Macros
; http://www.arclanguage.org/tut.txt
; We know enough now to start writing macros.  Macros are basically
; functions that generate code.  Of course, generating code is easy;
; just call list.
; 
; arc> (list '+ 1 2)
; (+ 1 2)
; 
; What macros offer is a way of getting code generated this way into
; your programs.  Here's a (rather stupid) macro definition:
; 
; arc> (mac foo () 
;        (list '+ 1 2))
; *** redefining foo
; #3(tagged mac #)
; 
; Notice that a macro definition looks exactly like a function
; definition, but with def replaced by mac.  
; 
; What this macro says is that whenever the expression (foo) occurs
; in your code, it shouldn't be evaluated in the normal way like a
; function call.  Instead it should be replaced by the result of
; evaluating the body of the macro definition, (list '+ 1 2).
; This is called the "expansion" of the macro call.
Print() Debugging prn
Lispy

View source

- Build the next great programming language · Search · Add Language · Features · Creators · Resources · About · Blog · Acknowledgements · Queries · Stats · Sponsor · Traffic · Traffic Today · Day 305 · feedback@pldb.com · Logout