Bläddra i källkod

small changes before Fixing the macro bug

master
Felix Brendel 6 år sedan
förälder
incheckning
3b85873039
3 ändrade filer med 11 tillägg och 8 borttagningar
  1. +1
    -1
      bin/pre.slime
  2. +5
    -6
      src/built_ins.cpp
  3. +5
    -1
      src/io.cpp

+ 1
- 1
bin/pre.slime Visa fil

@@ -411,7 +411,7 @@ by the key 'from' and ends with the number defined in 'to'."
result)
(define (map fun seq)
:doc "Takes a function and a sequence as arguments and returns a new
"Takes a function and a sequence as arguments and returns a new
sequence which contains the results of using the first sequences
elemens as argument to that function."
(if (null? seq)


+ 5
- 6
src/built_ins.cpp Visa fil

@@ -229,12 +229,10 @@ namespace Slime {
Lisp_Object_Type type = Memory::get_type(definee);
switch (type) {
case Lisp_Object_Type::Symbol: {
// BUG(Felix): Defining with doc string crashes
if (form != Memory::nil) {
Lisp_Object* doc = thing;
try_void assert_type(doc, Lisp_Object_Type::String);
try_void assert_type(form, Lisp_Object_Type::Pair);
form = form->value.pair.rest;
thing = form->value.pair.first;
try_void assert(form->value.pair.rest == Memory::nil);
// TODO docs
@@ -1053,16 +1051,17 @@ namespace Slime {
}
return Memory::t;
};
define((print (:sep " ") (:end "\n") . things), "TODO") {
define((print (:sep " ") (:end "\n") (:repr ()) . things), "TODO") {
profile_with_name("(print)");
fetch(sep, end, things);
fetch(sep, end, repr, things);
if (things != Memory::nil) {
print(things->value.pair.first);
bool print_repr = repr != Memory::nil;
print(things->value.pair.first, repr);
for_lisp_list(things->value.pair.rest) {
print(sep);
print(it);
print(it, repr);
}
}


+ 5
- 1
src/io.cpp Visa fil

@@ -304,7 +304,7 @@ namespace Slime {
}
proc string_buider_to_string(Array_List<char*> string_builder) -> char* {
int len = 1;
size_t len = 1;
int idx = 0;
for (auto str : string_builder) {
len += strlen(str);
@@ -479,6 +479,10 @@ namespace Slime {
return string_buider_to_string(string_builder);
}
default:
create_generic_error("A Lisp_Object of type-id %d cannot be converted to a string",
(int)(Memory::get_type(node)));
return nullptr;
}
}


Laddar…
Avbryt
Spara