Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Land of Lisp

Name: Anonymous 2012-01-10 23:28

You may be wondering why the command is called setf... I'm not sure why, actually

QUALITY PENMANSHIP!

Name: Anonymous 2012-01-10 23:36

setf = set form in place?

Name: Anonymous 2012-01-10 23:56

>>2
It probably means "set field," but interestingly enough, there is no documentation that supports this.

Name: Anonymous 2012-01-11 0:16

ANSI COMMON HOMOICONIC PILE OF HACKS OF UNCERTAIN ORIGINS

Name: Anonymous 2012-01-11 1:59

One day I got bored with Java.

Name: Anonymous 2012-01-11 5:57

>>5
So I tried a little Lisp and what I found was a surprise.

Name: Anonymous 2012-01-11 9:33

The SETF macro sets a generalized/field to some value.
Before it existed, there was a SET function a long time ago, before lexical scope, which sets a symbol value cell's (those values are typically used together with dynamic scope), this symbol is supposed to be contained within the first parameter(upon its evaluation). SET wouldn't make sense for local lexically scoped variables, but the most common usage was to quote the symbol, in the sense (set 'sym new-val), which led to the appearance of the setq function special form. Why is it a special form? Since now it can work with lexically scoped variables and also has a slightly different order-of-execution for instructions (allows setting multiple variables), when used on a dynamicly scoped variable, it will work like it used to work in the distant past: the set quoted, while when used on a lexically scoped variable, it will work as a regular assignment operator.

I think SETF appeared sometime after both of those forms, and it's author was someone who still posts on c.l.l, so the origin isn't that uncertain, but doing this sort of archeology isn't that easy either >>4.

I do believe someone actually wrote a document which documented how the assignment forms evolved over time, but I'm not sure I can find it...

Name: Anonymous 2012-01-11 12:36

>>7`
Computer Science, Majored in Lisp History

Name: Anonymous 2012-01-11 15:17

>>7
This is erotic literature to me.

Name: Anonymous 2012-01-11 17:44

>>6
It is a language so unique and so expressive

Name: Anonymous 2012-01-11 20:53

(check (my doubles))

Name: Anonymous 2012-01-11 23:52

>>11
; in: CHECK (MY DOUBLES)
;     (MY DOUBLES)
;
; caught WARNING:
;   undefined variable: DOUBLES
;
; caught STYLE-WARNING:
;   undefined function: MY
;
; compilation unit finished
;   Undefined function:
;     MY
;   Undefined variable:
;     DOUBLES
;   caught 1 WARNING condition
;   caught 1 STYLE-WARNING condition

Name: Anonymous 2012-01-12 1:37

>>11
(setf dubs 'checked)

Name: Anonymous 2012-01-22 17:45

Israel Shahak's book "Jewish History, Jewish Religion; The Weight of 3000 Years" (1994) shows how the past provides a key to understanding the present.
 
According to Shahak, the Jewish elite always had a symbiotic relationship with the governing class. The Jews would "administer the oppression" of the masses. In return, the governing class would force Jews to obey their "leaders." Sometimes a pogrom would do the trick.
 
The "Jewish" position was always strongest when the governing class was most at odds with the masses, and when there was least national feeling.
 
Today, specific Jews (in finance, government, education and especially the media) play a prominent role in the world elite's preparation for "globalization," which many see as a modern form of feudalism. Once again, "anti Semitism" is exploited to mobilize Jews (and Christians) to support oppression (e.g. "The War on Terror"), disarm opposition and to deflect blame.

The following is a brief summary of Shahak's argument
1. In spite of persecution, Jews throughout history formed an integral part of the privileged classes. The poorest Jew was immeasurably better off than the serfs. Until roughly 1880, their most important social function "was to mediate the oppression of the peasants on behalf of the nobility and the Crown."
2. Classical Judaism (1000-1880 AD) developed hatred and contempt for agriculture as an occupation and for peasants as a class. "The supposed superiority of Jewish morality and intellect...is bound up with a lack of sensitivity for the suffering of that major part of humanity who were especially oppressed during the last 1000 years, the peasants." (53)
3. While Gentiles in general were reviled, Jewish laws made an exception for the elite. Jewish physicians, tax collectors and bailiffs could be relied upon by a king, nobleman, pope or bishop, in a way that a Christian might not. The Jewish community enjoyed autonomous status and Jewish rabbis and rich were part of the governing class. Together they oppressed the masses, Jew and non-Jewish. (53)
4. The position of rich Jews is "particularly favourable under strong regimes, which have retained a feudal character" and are disassociated from the people they rule. "But in those countries where...the nobility enters into partnership with the king (and with at least part of the bourgeoisie) to rule the state, which assumes a national character," the position of the Jewish elite deteriorates.
5. However the position of the Jewish masses moved in tandem with the peasants not their leaders. The stronger the Jewish elite, the more tyrannical its grip over the Jewish people. For example, at the rabbis' request, the state would flog or imprison a Jewish vendor for opening his stall on a minor holiday.

Name: Anonymous 2012-01-22 17:58

SETF ::= SET Form

Definitely. There are no "fields" in Common Lisp.

SETF has to parse the syntax of the form in order to generate the appropriate code to store a value (or values) into it.

Originally there was SET, which was a function (now deprecated). It was used with quote all the time: (SET 'SYM VALUE).

Programmers got tired of the quote, so they made a SETQ operator: set with an implicit quote: (SETQ SYM VALUE).

This doesn't really save typing, but it does abstract the idea of assignment as an operation on a variable in the current environment, paving the way for assignment to lexical variables (since SETQ avoids the problem that SET has: not having access to the parent environment.)

In Common Lisp, SYM can be a symbol macro that expands to an arbitrary form and SETQ will work through this to assign to the target form. SETQ is just a form of SETF where the form is syntactically restricted to being a symbol, but semantically that symbol doesn't have to denote a simple variable.

Name: Anonymous 2012-01-23 16:35


Don't change these.
Name: Email:
Entire Thread Thread List