Skip to content

Commit

Permalink
print/say should return "" not nil
Browse files Browse the repository at this point in the history
as in perl. "" is silent
  • Loading branch information
Reini Urban committed Oct 20, 2013
1 parent 7ea88e2 commit c2d46fd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions core/string.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ static PN potion_str_clone(Potion *P, PN cl, PN self) {
///\returns nil
static PN potion_str_print(Potion *P, PN cl, PN self) {
fwrite(PN_STR_PTR(self), 1, PN_STR_LEN(self), stdout);
return PN_NIL;
return PN_STR0;
}

static size_t potion_utf8char_offset(const char *s, size_t index) {
Expand Down Expand Up @@ -401,7 +401,7 @@ PN potion_bytes_string(Potion *P, PN cl, PN self) {
static PN potion_bytes_print(Potion *P, PN cl, PN self) {
self = potion_fwd(self);
fwrite(PN_STR_PTR(self), 1, PN_STR_LEN(self), stdout);
return PN_NIL;
return PN_STR0;
}

///\memberof PNBytes
Expand Down
4 changes: 2 additions & 2 deletions core/table.c
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ PN potion_tuple_first(Potion *P, PN cl, PN self) {
///\memberof PNTuple
/// "join" method.
///\param sep PNString
///\return PNString
///\return PNBytes
PN potion_tuple_join(Potion *P, PN cl, PN self, PN sep) {
DBG_CHECK_TYPE(self,PN_TTUPLE);
PN out = potion_byte_str(P, "");
Expand Down Expand Up @@ -522,7 +522,7 @@ PN potion_tuple_print(Potion *P, PN cl, PN self) {
PN_TUPLE_EACH(self, i, v, {
potion_send(v, PN_print);
});
return PN_NIL;
return PN_STR0;
}

///\memberof PNTuple
Expand Down

0 comments on commit c2d46fd

Please sign in to comment.