Permalink
Browse files

Made pp() return a debug statement instead of a string to be debugged…

…. Made pp() not print the multiline decoration when we only had one line of stuff to print. (Inefficiently.)
  • Loading branch information...
1 parent 8faa64f commit ab3b3af6a7f02f400facea772cd36060ab93cfb5 @DDR0 DDR0 committed Jan 6, 2013
Showing with 6 additions and 4 deletions.
  1. +6 −4 data/functions.cfg
View
@@ -336,10 +336,12 @@
{
name: "pp", //pretty-printing function.
args: "input",
- formula: "if(not strstr(pretty, '\n'),
- _pp(input, 0),
- '\n\n\n\n===OUTPUT===\n\n' + pretty + '\n===FINISHED===\n\n\n\n')
- where pretty = _pp(input, 0)",
+ formula: "debug(
+ if(not strstr(pretty, '\n'),
+ pretty,
+ '\n\n\n\n===OUTPUT===\n\n' + pretty + '\n\n===FINISHED===\n\n\n\n'
+ ) where pretty = flex_sum(if(last(cp)='\n', cp[0:size(cp)-1], cp) where cp = split(_pp(input, 0), ''), '')
+ )",
},
//pp(find(get_save_document(0).character, value.is_human).vars.saved_maps)

0 comments on commit ab3b3af

Please sign in to comment.