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

top 50 comments

sorted by: hot top controversial new old
[โ€“] 5 points 1 hour ago* (last edited 1 hour ago) (1 child)

Listening to a Tim Schafer interview and really relating to this:

I'm not like a pacifist, but sometimes I get tired of a game where it's an entirely beautiful world with a great character and [when] you roam across the world it's like, what do you do? You kill everything you find. Like the whole game is to just kill everything you find. It's just creatively, I'd like to see something more creative happen when I'm going through these amazing worlds.

It almost feels contradictory to say, given the games I always talk about, but I've noticed my need to balance combat heavy JRPGs and shooters with non-violent games too. It's nice that the indie space has so many interesting games that fit that description. In the last month or so, I played both Duck Detective games and Catto's Post Office. Those were a really nice break from it all.

Now back to playing Fortune's Weave for 4-5 hour sessions catgirl-smug

  • source
  • hideshow 1 child comment
  • worries about upcoming overseas trip with family to see family

    So this weekend I'm on 'holiday' with my father, his partner and my older sibling. This is the first time in what feels like forever going on holiday and also visiting my parents' home country to visit my father's parents. And the last time I went to that home country was exactly just before COVID.

    I really don't know how its gonna go, considering I'm trans with dyed hair and I'm closeted to the rest of my family (except my father), we have to pick up my sibling which means possibly seeing my mum again (a person I cut off a long time ago) and visiting my childhood home and town. Plus I haven't been around family properly for more than a day in a long while. I at least have my Dad for some protection from his family when we get there but to be honest considering what I have said previously about him I'm putting trust in someone who I can't fully trust.

    I know it will be hard, seeing both the hometown I grew up in the country I live in now and also my father's village over there where I spent many holidays when I was young. Now that I'm trans this is probably the last time I can go there relatively safely, which writing this makes me cry and feel awful.

    I hope it goes fine and I can relax. But it will be scary and its hard to prepare myself for this event. I guess writing my thoughts out like this helps.

  • source
  • Super excited to dress as a witch this year for Halloween.

    It's my favourite time of the year but dysphoria has gotten in the way of me being able to really enjoy the costuming part of holidays.

    No more.

    I've got this oversized flowy tunic thingy, I'm waiting for this little hooded cape/shawl thing to arrive, I'm gonna throw it over some spooky fishnets and some short shorts. Now I just needta track down a pointy hat.

  • source
  • [โ€“] 8 points 3 hours ago (1 child)

    has anyone here ever had despair so intense you think for a moment you're having a heart attack, you can't move, and when you try to speak you only exhale?

  • source
  • hideshow 1 child comment
  • [โ€“] 11 points 6 hours ago

    I see this on cultivation reddit a lot where readers wax poetic about how superior Chinese novels are to Japanese novels from peolple who don't realise that they were reading Japanese novels aimed at 15 year olds while reading Chinese novels aimed at 20+ year olds.

    Like, these people don't seem to have realised that they ... grew up? And their tastes in fiction changed as they grew up?!

    The fact that the chinese culture boom coincided with you becoming an adult is just that, a coincidence.

  • source
  • [โ€“] 13 points 7 hours ago (4 children)

    Three nightmares tonight Jesus. First my family and I had been made homelessnand were living in a school. There was some dark shadow figure. And we were stressed about police finding us. I remember hiding and getting a bad night sleep. Waking up to my things everywhere.

    Second dream I'm driving but not well. It's very fuzzy on the logic but the my sister is driving the car in front, me driving what's in back, she loses control, I struggle to stop from hitting her, then from stopping from rear ending a cop, then I can't stop the car so it's a whole car chase.

    Then a nightmare where I was stuck in hell one hour a day. My inner self didn't know why this was happening. Every day we got a new person. Se real people, some new. There was a demon who kept trying to beat me up, and would grow strong, then go back to being a little girl so everyome would think she was innocent. Then a demon who would steal and use your voice, they took her voice away. Then my family dog who would attack my legs. There were others that I can't remember. I saw hell, but the actual area was more like series of bookshelves. Very disorienting. That's when I finally was able to wake myself up.

  • source
  • hideshow 4 child comments
  • [โ€“] 6 points 2 hours ago

    Nightmares suck cuddle

    Weirdly enough I usually don't remember my dreams so I guess I also don't remember my nightmares most of the time, but the ones I do are either bonkers, like being teleported to the side of a building that is broken and being pushed by a strange force towards the edge before teleporting back a few meters or a recurring one I have since I was a child (I think I talked about this here on the bear site before) where I'm stuck in a small white room with an old wooden slatted bed base on the left corner of the room, a giant elastic band on the middle of the room, a closed metal door I think, and a humanoid creature with large teeth and claws that is constantly running towards me but the giant elastic never let's them reach me, I'm always stuck halfway from the creature and the bed and then reality starts to warp and I start to zoom in and out of stuff in the room like a corner of the bed, or the slates, or my own ear or the creatures ear, and when that happens, it's not just a zoom, but the point of observation keeps changing sizes while the background becomes infinitely huge.

  • source
  • parent
  • [โ€“] 15 points 8 hours ago (3 children)
    [โ€“] 14 points 9 hours ago (3 children)

    Ok, I'm going to do mushrooms on Friday. Last time was a bit aimless. This time I want to have some gender-y trans-y media ready to go and engage with (or meditate on, if I can direct myself that much). Taking suggestions

  • source
  • hideshow 3 child comments
  • [โ€“] 4 points 3 hours ago*

    May I gently ask that you place discussions of drugs under a spoiler tag? It can be triggering to people who are in recovery or have had bad experiences

    cw: drugs

    Reading Inanna, Lady of Largest Heart by Betty De Shong Meador is an incredible experience on its own and mushrooms may enhance it. Theres like 5000 year old gender stuff in it and I hand out my copy to every transfem I meet lol.

    My reccomendation is to read part 1 to get the historical context (maybe do this sober/while coming up) and then skip to the poem on page 117 (its the 139th page of the pdf) when youre well into your trip. Don't read the commentary on the poem until you have read the poem itself. I'm not going to tell you what to look for, but you will know it when you see it.

    The book is readily available on z-library.

  • source
  • parent
  • [โ€“] 9 points 7 hours ago

    advice for a ritual and meditation for self directed discovery / affirmation

    consider it a special mission and start by writing down the objectives of this ritual. If the objective is to deepen your understanding or relationship to yourself, write that down. Write a paragraph about the intentions you have for the mission, any important details that you want to mention.

    Anchoring the ritual to an event or natural phenomenon can be useful. I use the moon for this. Any phase in the moon cycle is useful imo, just be sure to record it. You could also just record the weather and conditions you will be preforming the special mission under.

    Write about how you will affirm the mission. Something like "I will sit for at least 15 minutes and meditate upon the objective of this ritual" if you are spiritual, religious, or otherwise-- you can also ask them for help. I have personally used ancestors for the purpose of self discovery and understanding. I have specified that I only wanted the cool ones to respond.

    Meditation is usually done to empty the mind, but in this situation you will be using it to direct your mind into having visions. Write down any visions you have related to the objective, if possible. Try practicing basic meditation techniques beforehand if you think that might help.

    If you want to watch trans media as apart of the mission, go ahead and write that down too.

    Don't worry if things go off the rails or don't go as planned. If you just want to do a small little meditation and be done / move on to other things, that's fine. If you find you want to sit with yourself longer, then allow yourself to do so.

    Then leave a space on your paper for the conclusion. This is where you will come back and write about your experiences during the ritual, and if you felt it was effective.

    Pay attention to any small coincidences or signs that you see afterwards and if they say anything to you. Sometimes you can have dreams directly after a ritual like this that are very relevant.

  • source
  • parent
  • [โ€“] 11 points 9 hours ago

    Even if I did tons of good work on this fucking research project, forgetting to show up to the meeting is a quick way for the professor to think of me as trash. Won't even let me join online. I can only hope that there are no consequences for my actions and my group mates will let me in on the secrets or whatever convo they are having that is so classified it can't be discussed online

  • source
  • load more comments
    view more: next โ€บ