Skip to content

Commit 5766c61

Browse files
committed
Merge pull request pixie-lang#194 from heyLu/fix-print
Return nil from print, println, pr and prn
2 parents e89c335 + 301c092 commit 5766c61

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

pixie/stdlib.pxi

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1217,13 +1217,15 @@ and implements IAssociative, ILookup and IObject."
12171217
{:doc "Prints the arguments, seperated by spaces."
12181218
:added "0.1"}
12191219
[& args]
1220-
(printf (transduce (interpose " ") str args)))
1220+
(printf (transduce (interpose " ") str args))
1221+
nil)
12211222

12221223
(defn println
12231224
{:doc "Prints the arguments, separated by spaces, with a newline at the end."
12241225
:added "0.1"}
12251226
[& args]
1226-
(puts (transduce (interpose " ") str args)))
1227+
(puts (transduce (interpose " ") str args))
1228+
nil)
12271229

12281230
(defn pr-str
12291231
{:doc "Formats the arguments using -repr, separated by spaces, returning a string."
@@ -1235,13 +1237,15 @@ and implements IAssociative, ILookup and IObject."
12351237
{:doc "Prints the arguments using -repr, separated by spaces."
12361238
:added "0.1"}
12371239
[& args]
1238-
(printf (apply pr-str args)))
1240+
(printf (apply pr-str args))
1241+
nil)
12391242

12401243
(defn prn
12411244
{:doc "Prints the arguments using -repr, separated by spaces, with a newline at the end."
12421245
:added "0.1"}
12431246
[& args]
1244-
(puts (apply pr-str args)))
1247+
(puts (apply pr-str args))
1248+
nil)
12451249

12461250
(defn repeat
12471251
([x]

0 commit comments

Comments
 (0)