Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
@Demolishun i did search, infact its documentation is on the book im reading, i am just saying that lexical variables are fucking confusing and deserve a better explanation
-
C0D4681455y@frogstair 🤔 I get this result.
When a variable is lexically scoped, the system looks to where the function is defined to find the value for a free variable. When a variable is dynamically scoped, the system looks to where the function is called to find the value for the free variable. -
Lexical variable: not in my scope, can't see shit. Did you not see the brackets on the way in?
-
@frogstair yeah i know what it is but lisp has a twist added to it which makes it confusing
-
@SortOfTested lexical variables are pretty simple in other languages but in common lisp oh boy did i suffer learning them
-
@yellow-dog i think the last example was (defparameter *fn* ( let ((a 1)) (lambda (x) (+ a x))))
and then (funcall *fn* 6)
which would i give 7
i understand what it does but im not really getting the meaning of it, a lexical variable is one binded with the function? -
Sorry, this is clojure syntax, havent used lisp in a long time but they are fairly similar. Look up variable shadowing.
In this case, var1 is a lexical variable of the function scope and the universe scope, with function scope taking precedence. -
@Gregozor2121 yeah but in lisp theres 2 types of local lexicals and some other, lexicals have somekind of twist
bruh wtf is a lexical variable
rant