slack1
2017-12-5 17:18:02

Is there a way to “destructure” multiple values, such as from (quotient/remainder), so that you don’t have to explicitly assign them somewhere? Or how do people normally use (quotient/remainder)?


lexi.lambda
2017-12-5 17:18:43

define-values or let-values will do it.


slack1
2017-12-5 17:19:20

ah I see, thanks


slack1
2017-12-5 17:19:50

I was thinking that let-values would perhaps do an extra assignment, but I guess that’s the way to do it


lexi.lambda
2017-12-5 17:19:54

More generally, match-define and match-let from racket/match can pattern-match on/destructure other sorts of things.


lexi.lambda
2017-12-5 17:20:57

And there’s match-define-values and match-let-values that combine that behavior with multiple-value handling, though I generally think racket/match subsumes multiple values and should usually be preferred instead of returning multiple values at all.


slack1
2017-12-5 17:21:37

I’ll definitely check out match


slack1
2017-12-5 18:09:19

How does one view previous historical commands for DrRacket on MacOS?


slack1
2017-12-5 18:10:44

For Ubuntu I’d just use up-arrow


lexi.lambda
2017-12-5 18:12:26

I think Ctrl+Up will do it.


slack1
2017-12-5 18:13:22

ah I see, I need to remap interfering macos default hotkeys


slack1
2017-12-6 02:27:11

Perhaps I’m misinterpreting the point-free style, but so far I’ve found it very easy to use and learn


slack1
2017-12-6 02:27:19

i’m surprised people say that it’s a code smell


slack1
2017-12-6 02:27:32

For me, point-free implies a chain of single-arity functions


slack1
2017-12-6 02:27:55

That’s so much easier to think about than matching function arities


notjack
2017-12-6 02:40:38

@slack1 there are much more complex ways of writing point free code than what is provided in the point-free package


slack1
2017-12-6 02:45:54

So far I’ve just been using it as an easy compose


slack1
2017-12-6 04:03:17

Would stream-fold be the right way to implement something like a “pairwise” stream operation, or, “for every 2”



slack1
2017-12-6 04:13:09

ahh whoaa


slack1
2017-12-6 04:13:17

in an entirely different library I see


slack1
2017-12-6 04:13:22

with such useful stuff


notjack
2017-12-6 04:18:28

courtesy of Alexis