Lisp influence on on Factor programming language?
Asked Answered
S

3

7

I have read (from Slava Pestov) that Factor was influenced by Lisp, but I am not sure that I can understand how? Are they not very difference programming languages?

Sferics answered 10/9, 2010 at 0:47 Comment(0)
R
9

Even though the language is stack based there are plenty of elements that show a clear lisp influence. Take the IF statement as an example. In forth If statements are cond IF (code if true) ELSE (code if false) THEN and the definition of If acts on the runtime to make sure the correct branch is run. If in factor is a direct translation of if in lisp it takes a true quotation and a false quotation and executes the correct one. Edit: Another is Dynamic scope, Something CL is known for. Its lexical variables are defined by let expressions just like lisp.(let and let* )

Rosa answered 22/9, 2010 at 19:48 Comment(0)
P
8

The object system, for one: http://concatenative.org/wiki/view/Object%20system, resembles CLOS.

Perimeter answered 11/9, 2010 at 17:6 Comment(0)
K
0

Well, the whole "code as data" philosophy is also pretty present in Factor, from the little I've seen of it so far. There are macros, you can quote code and manipulated quoted code as sequences. Basically, a quotation in Factor is equivalent to a quoted list/s-expression in Lisp. Lisp goes a bit further by using s-expressions for all code.

Karonkaross answered 25/8, 2015 at 2:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.