Skip to content

Instantly share code, notes, and snippets.

View pkutaj's full-sized avatar

pavol kutaj pkutaj

View GitHub Profile
@pkutaj
pkutaj / tmp2tu2xyzz.scheme
Created August 11, 2026 13:52
The Substitution Model snippet
(define sq (lambda (n) (* n n)))
(assert (= (sq 5) 25)) ;PASS
@pkutaj
pkutaj / tmpj2f1j5_w.scheme
Created August 11, 2026 13:51
The Substitution Model snippet
(define sqs (lambda (x y) (+ (sq x) (sq y))))
(assert (= (sqs 2 3) 13)); PASS
@pkutaj
pkutaj / tmpc3py1h7_.scheme
Created August 11, 2026 13:51
The Substitution Model snippet
;👇 eval operator
(sqs 2 3)
;👉 (lambda (x y) (+ (sq x) (sq y)))
@pkutaj
pkutaj / tmpnzo_4t2k.scheme
Created August 11, 2026 13:51
The Substitution Model snippet
;👇👇 eval operands
(sqs 2 3)
; 👉 2
; 👉 3
@pkutaj
pkutaj / tmppxf28luy.scheme
Created August 11, 2026 13:51
The Substitution Model snippet
;👇 body of the procedure ;👇 arguments
;(+ (sq x) (sq y))) ; 2 3
;applied 👉 (+ (sq 2) (sq 3))
@pkutaj
pkutaj / tmp8gfjd6d2.scheme
Created August 11, 2026 13:51
The Substitution Model snippet
(sqs 2 3)
(+ (sq 2) (sq 3))
(+ (sq 2) (* 3 3))
(+ (sq 2) 9)
(+ (* 2 2) 9)
(+ 4 9)
13
@pkutaj
pkutaj / tmp2mi8_b0i.c
Created July 20, 2026 07:11
CTJ54_Pointer Pointers snippet
#include <stdio.h>
int x = 42;
int *p = &x;
printf("The value of p is %p and is pointing to %d\n", p, *p);
// The value of p is 0x1080b8000 and is pointing to 42
@pkutaj
pkutaj / tmpu7xr6wb_.txt
Created July 20, 2026 07:11
CTJ54_Pointer Pointers snippet
0x00000001080b8000
@pkutaj
pkutaj / tmppyq2zuf5.c
Created July 20, 2026 07:11
CTJ54_Pointer Pointers snippet
#include <stdio.h>
int main() {
int x = 1;
int y = 2;
int checkpoint = 0;
int *ptr = &x;
int **ptr_ptr = &ptr;
checkpoint = **ptr_ptr;
printf("%d\n", checkpoint); // 1
@pkutaj
pkutaj / tmpzpgut9og.md
Created July 20, 2026 07:11
CTJ54_Pointer Pointers snippet
Name Address Value Inferred Type / Role
v1 0x04 1 Integer Variable
v2 0x08 2 Integer Variable
checkpoint 0x12 1 Integer / Boolean Flag
ptr 0x20 0x04 Pointer (Points to v1)
ptr_ptr 0x28 0x20 Pointer to Pointer (Points to ptr)