i think i remeber seeing essentially with-input-from-file but it would call with each line, but i cant find it again, am i dreaming ?
attempting advernt of code with rust this year :smile:
@chris613 I’d use a for loop with in-lines for that
in-lines i think thats maybe the magic bit i was thinking of
Is there a way of getting a sub-list from the beginning of a list of length n, or a number < n if the list is too short? e.g (my-take '(1 2 3 4 5) 2) ; => '(1 2)
(my-take '(1 2 3 4 5) 20) ; => '(1 2 3 4 5)
“take of length n, unless there ain’t enough, then give me what you have”
Answering my own question after rtfm: (for/or ([chunk (in-slice length data)]) ....
What’s the best way to convert 1234567.8 to 1,234,567.80 ? I found the racket-locale package which gets close with 1,234,567.8 but that looks goofy as a currency number.
I know how to get the .80 part with ~r but it doesn’t do the commatizing
I too would like to know that. I wrote a bad hack (that only works with formatting integers) the other day to solve this.
It’s not that difficult, but if I’m going to code something up, it seems like it might be best to add a keyword arg to ~r