Vindaar / ggplotnim

A port of ggplot2 for Nim
https://vindaar.github.io/ggplotnim
MIT License
177 stars 15 forks source link

String representation of formulas broken for fn calls with multiple args #102

Closed Vindaar closed 3 years ago

Vindaar commented 3 years ago

The string representation of the following formula:

mport ggplotnim

const cut_rms_trans_low = 0.1
const cut_rms_trans_high = 1.5
proc inRegion(x, y: float, r: string): bool =
  discard

let fn = f{float -> bool:
  `rmsTransverse` >= cut_rms_trans_low and
  `rmsTransverse` <= cut_rms_trans_high and
  inRegion(df["centerX"][idx], df["centerY"][idx], "crSilver") and
  `hits` < 500}

echo fn

yields:

(and (and (and (>= rmsTransverse cut_rms_trans_low) (<= rmsTransverse cut_rms_trans_high)) (inRegion df["centerX"][idx])) (< hits 500))

which is missing the second and third argument to inRegion!

It's about time to redo the whole formula macro..!

Vindaar commented 3 years ago

Fixed by #115.