This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket | |
;; creating class-like abstractions using functions only | |
(define (animal name) ; abstract class | |
(lambda (member) | |
(cond | |
[(or (eq? member 'type) | |
(eq? member 'base-type)) 'animal ] | |
[(eq? member 'name) name ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket | |
;; arithmetic expressions | |
(define (const? t) | |
(number? t)) | |
(define (op? t) | |
(and (list? t) | |
(member (car t) '(+ - * / = > >= <= <)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
COMPILER = # FILL # compiler | |
FLAGS = # FILL # compiler flags | |
LIBS = # FILL # linked libraries | |
TARGET = # FILL # name (and path) of the executable | |
# to use with .cpp change *.c to *.cpp | |
SRC = $(shell find src -name "*.c") | |
OBJ = $(patsubst src/%.c, build/%.o, $(SRC)) | |
DEP = $(OBJ:%.o=%.d) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <string> | |
namespace implementation | |
{ | |
template <typename T> | |
inline auto stringify(const T& t) -> std::string | |
{ | |
return std::to_string(t); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <math.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <stdint.h> | |
#ifndef M_PI | |
#define M_PI 3.14159265358979323846 | |
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
char s [] = {-1 }; int main () {int a = 0; /*-}2137{-*/ int xd[] = {a--}; short id = 0; long Nothing = 0; a = Nothing >>= id; --a;} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.15) | |
project(program_name VERSION 0.0.1) | |
set(CMAKE_CXX_FLAGS "-Wall -Wextra -pedantic --std=c++17 -Og -fsanitize=address,undefined") | |
set(CMAKE_CXX_FLAGS_RELEASE "-Wall -Wextra -pedantic --std=c++17 -Werror -O2") | |
file(GLOB_RECURSE SOURCES src/*.hpp src/*.cpp) | |
include_directories(${CMAKE_SOURCE_DIR}) |