This week's topic is quite programming heavy, sorry to all non programmers doggirl-gloom

https://xkcd.com/312/

yap

LISP stands for LISt Processing and was invented by John McCarthy, who was looking computation with symbols and recursive functions in the 1960s.

John McCarthy was the son of immigrant Communists (members of the CPUSA), but after witnessing the failed counter-revolution in Prague in 1968, he himself became a Republican lenin-dont-laugh.

A Lisp program consist of a few basic building blocks:

  • Symbols - basically text without whitespace, for example: +, hello123, if, nil, etc.
  • Numbers, Strings, etc.
  • Cons cells - a Pair, denoted as (cons 1 2) or dotted (1 . 2)
  • Lists - a linked list of Cons cells with the final element being the symbol nil.
    • (list 1 2 3) is the same as (1 . (2 . (3 . nil))).

As you may have noticed, cons and list are inside the parentheses, thats because a function call like f(x,y) is written instead as (f x y). This is called a Symbolic expression and all Lisp code looks like this.

(+ 1 (* 2 3) 4)
;; multiply 2 times 3 => (+ 1 6 4)
;; add 1 6 and 4      => 11

;; the names 'car' and 'cdr' are ancient relics from some assembly instructions
;; basically first and second element of a cons cell
;; or head and tail of a list
(car (cons 1 2)) ;; => 1
(cdr (cons 1 2)) ;; => 2

This in turn means that any code can be turned into a list, so that it can be modified like data. I think thats quite neat and unique among programming languages (it even has a fancy word: this property is called homoiconicity).

Functions that operate on code are called macros.

;; generate a function 'name' that adds 'value' to the input
(defmacro defun-adder (name value) 
  (list 'defun name (list 'x) (list '+ 'x value)))
 
(defun-adder plus5 5)
;; define the function plus5(x) as x + 5 
;; => (defun plus5 (x) (+ x 5)))

(plus5 10) ;; => 15

To make sure the interpreter does not try to evaluate a symbol, it needs to be "quoted". Since this comes up quite often, it gets the shortcut of ' at the beginning.

Theyre much nicer to work with than for example macros in C:

#define PI 3.14159265

this C macro just searches and replaces the string PI in the C source code before compilation and theres lots of ways to mess up, for example

#define DOUBLE(x) x + x

if x is a function call that does something else, like printing, then that message will appear twice. Operator prescedence is also not considered: DOUBLE(1) * 3 will expand to 1 + 1 * 3, so 4 not 6 like one would expect.

The last thing I want to yap about is Lisp1 vs Lisp2. This refers to the amount of namespaces any programming language has. if functions and variables are allowed have same names, then there needs to be a namespace for each.

for example in CL:

(defvar x 1)
(defun x () (+ 1 1))

x   ;; variable      => 1
(x) ;; function call => 2

is perfectly fine, while in other languages like Python or C or Scheme this wouldnt work.

Shoutout to respected comrades lilypad and sodium_nitride who are also true Lisp patriots.


___ Join our public Matrix server! https://rentry.co/tracha#tracha-rooms ___

As a reminder, please do not discuss current struggle sessions in the mega. We want this to be a little oasis for all of us and the best way to do that is not to feed into existing conflict on the site. Also, be sure to properly give content warnings and put sensitive subjects behind proper spoiler tags. It's for the mental health of not just your comrades, but yourself as well.

Here is a screenshot of where to find the spoiler button.

spoiler

Common Lisp Logo, an alien holding a flag with the word LISP on it
you are viewing a single comment's thread
view the rest of the comments
[–] 19 points 1 day ago* (last edited 1 day ago) (5 children)

I had the most pleasantly suprising counseling appointment today. He was quite young and still in training to become a clinical psychologist so our session was recorded... which didn't bother me as much as I would have thought.

but like he was a cishet white dude who like... actually made me feel seen and heard as a transgender woman. Hes done his research and he didnt do that "oh well because of my privlege I could never really know" cop out bullshit. The look of genuine empathy on his face when I told him I had spent 13 years in the closet was extremely suprising, in a good way.

I got to talk about a lot and I think that I've really been going through a lot recently.

Is it bad that he initally wanted to start me on weekly appointments?

Addendum:

removed on account of morning-after cringe

  • source
  • hideshow 5 child comments
  • [–] 3 points 18 hours ago

    Weekly appointments are pretty standard unless you're "worried well" and extremely low acuity or else they can't see you more often. Intensive therapy is 2x/week or more.

    I've been seriously impressed by some of the psych people I've interacted with. Random corn-fed cis women who already understand transmisogyny and are normal about gender in a way I don't expect from helping professionals (or anyone tbh). I wonder if there's been a shift in training to foreground trans stuff, more places?

    Another thought: as the backlash against what tentative moves towards trans rights got made in the burgerreich get rolled back, people are having to take a stand where they might have been indifferent before. The vibes are different than they were 5, 10 years ago. People I'd have written off as performative then, keep showing up now.

    There is an ebb and flow to these things. That kindness, that concern, is what we deserve, and we should expect no less. I see it in most people in training where I am. We will prevail. We have to prevail.

  • source
  • parent
  • [–] 13 points 1 day ago (3 children)

    Is it bad that he initally wanted to start me on weekly appointments?

    I think this is fairly typical?

  • source
  • parent
  • hideshow 3 child comments
  • [–] 7 points 1 day ago (2 children)

    I've heard its an indicator that the practitioner sees the paitent as needing more help than usual.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 12 points 1 day ago

    an hour once a week is far from intensive... but my perspective is pretty skewed because i only know mentally ill people and I've personally done hundreds of hours of intensive therapy over the last few years. most importantly it isn't bad or shameful to need any level of help!

  • source
  • parent
  • [–] 10 points 1 day ago

    where i live the truly intense therapy is twice a week (and also isnt fully covered by the public healthcare and ends up costing 130€ a pop on the cheap side) and daily if you go to the psych ward.

    once a week is standard catgirl-peace

  • source
  • parent