{"id":13846353,"url":"https://github.com/cospplredman/PPLISP","last_synced_at":"2025-07-12T07:32:28.083Z","repository":{"id":205672994,"uuid":"714793468","full_name":"cospplredman/PPLISP","owner":"cospplredman","description":"c-prepocessor lisp ","archived":false,"fork":false,"pushed_at":"2023-11-05T22:20:03.000Z","size":12,"stargazers_count":13,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-02-17T10:36:23.022Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cospplredman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-11-05T20:28:34.000Z","updated_at":"2024-02-14T19:01:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"c953158d-ae01-43ee-ad28-58a58f15acc3","html_url":"https://github.com/cospplredman/PPLISP","commit_stats":null,"previous_names":["cospplredman/pplisp"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cospplredman%2FPPLISP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cospplredman%2FPPLISP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cospplredman%2FPPLISP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cospplredman%2FPPLISP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cospplredman","download_url":"https://codeload.github.com/cospplredman/PPLISP/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225807252,"owners_count":17527219,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T18:00:30.818Z","updated_at":"2024-11-21T21:30:24.749Z","avatar_url":"https://github.com/cospplredman.png","language":"C","funding_links":[],"categories":["Compilers/Interpreters"],"sub_categories":[],"readme":"# PPLISP\nthis is a set of 45 macros that allow for lisp-like preprocessor meta programming.\n\n# USAGE\nto use PPLISP in your project just include PPLISP.h\n```c\n#include \"PPLISP.h\"\n```\nincluding PPLISP.h a second time will undefine all of the PPLISP macros.\n\nto evaluate a PPLISP:TM: expression use the following\n```c\nEXP( EVAL ( /*expr*/ ) )\n```\nthe `EXP` macro applies 3^10 or so scans of the preprocessor and the `EVAL` macro does all of the hard work of figuring out what your expression means.\n\n## expressions\na pplisp expression has the following format\n`(MACRO, EXPR1, EXPR2, ..., EXPRN)`\nthe result of evaluating EXPR1, ..., EXPRN are passed to MACRO as ARG1, ... ARGN\n\n## primitives\nthe following macros are defined for use as PPLISP primitives\n- QUOTE ($)\n    evaluates to the list of its unevaluated arguments\n\n    the $ macro appends QUOTE to the front of its argument list\n    EX: $(a, b, c) =\u003e (QUOTE, a, b, c)\n\n- CONCAT\n    concatenates arrays passed to ARG1 and ARG2 and returns the result\n\n- IF\n    if ARG1 evaluates to (T)\n    then return the result of evaluating ARG2\n\n    if ARG2 evaluates to (F)\n    then return the result of evaluting ARG3\n\n- FST\n    returns the first element of the list passed to ARG1\n\n- RST\n    returns all but the first of the elements passed to ARG2\n\n- IS_NIL\n    if the list passed to ARG1 is empty evaluates to (T) otherwise it evaluates to (F)\n\n\n## defining additional PPLISP primitives\n\nto define additional primitives simply make a macro like so\n```c\n#define M_MACRONAME MACRONAME\n#define MACRONAME(ARG1, ARG2, ..., ARGN)EVAL( /*expr*/ )\n```\nrecursive primitives are totally allowed, feel free to experiment! \n\n## examples\nhere is an example of a NOT macro\n```c\n#define M_NOT NOT\n\n/* the trailing \\ tells the preprocessor to delete the newline allowing for multiline macro definitions*/\n#define NOT(a) EVAL\\\n((IF,$ a,\\\n\t$(F),\\\n\t$(T)))\n\n/*without the $() EVAL will attempt to evaluate T or F which doesn't make any sense*/\n\nEXP(\nEVAL(\n    (NOT, $(T)) /*evaluates to (F)*/\n)\nEVAL(\n    (NOT, $(F)) /*evaluates to (T)*/)\n)\n)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcospplredman%2FPPLISP","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcospplredman%2FPPLISP","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcospplredman%2FPPLISP/lists"}