29 lines
878 B
C
29 lines
878 B
C
/**
|
|
* symbol.c
|
|
*
|
|
* Post Scarcity Soctware Environment
|
|
*
|
|
* TODO: Edit purpose.
|
|
*
|
|
* Copyright (c): 27 Apr 2026 Simon Brooke <simon@journeyman.cc>
|
|
* Licensed under GPL version 2.0, or, at your option, any later version.
|
|
*/
|
|
|
|
#include <wctype.h>
|
|
|
|
#include "memory/pointer.h"
|
|
#include "memory/tags.h"
|
|
#include "ops/string_ops.h"
|
|
|
|
/**
|
|
* Construct a symbol from the character `c` and this `tail`. A string is
|
|
* implemented as a flat list of cells each of which has one character and a
|
|
* pointer to the next; in the last cell the pointer to next is NIL.
|
|
*
|
|
* @param c the character to add (prepend);
|
|
* @param tail the symbol which is being built.
|
|
*/
|
|
struct pso_pointer make_symbol( struct pso_pointer frame_pointer, wint_t c,
|
|
struct pso_pointer tail ) {
|
|
return make_string_like_thing( frame_pointer, c, tail, SYMBOLTAG );
|
|
}
|