tonyg changed the topic of #racket to: The Racket Programming Language -- https://racket-lang.org/ -- https://gather.town/app/wH1EDG3McffLjrs0/racket-users -- http://pasterack.org -- logged at https://libera.irclog.whitequark.org/racket/ -- This is the right place to ask for help with (Dr)Racket. Remember to wait around for an answer!
badkins has joined #racket
libertyprime has quit [Quit: leaving]
<williewillus> curiousity question: are multiple values implemented any differently internally than just lists or vectors?
<williewillus> I know theoretically they are presented as a dual to explicit positional arguments, but inputs can be optimized because we know how many there are going to be ahead of time (rest args notwithstanding). For outputs I can randomly return two or three things using `values` whenever I like.
badkins has quit [Remote host closed the connection]
badkins has joined #racket
codingquark has quit [Ping timeout: 246 seconds]
badkins has quit [Remote host closed the connection]
codingquark has joined #racket
codingquark has quit [Ping timeout: 246 seconds]
sunarch has quit [Ping timeout: 248 seconds]
codingquark has joined #racket
henderson has quit [Ping timeout: 248 seconds]
henderson has joined #racket
sunarch has joined #racket
sunarch has quit [Max SendQ exceeded]
sunarch has joined #racket
<samth> williewillus: yes, multiple values are implemented somewhat differently
sunarch has quit [Max SendQ exceeded]
<samth> in some cases they end up reified in the heap, but less often than for a vector or a lit
<williewillus> interesting, so the compiler can specialize if it can detect that for example, a function always returns 2 values at once and never 1 or 3+?
<samth> yes
sunarch has joined #racket
<samth> see, for example, procedure-result-arity
jao has quit [Ping timeout: 246 seconds]
sunarch has quit [Max SendQ exceeded]
sunarch has joined #racket
badkins has joined #racket
badkins has quit [Ping timeout: 256 seconds]
GreaseMonkey has quit [Ping timeout: 255 seconds]
<williewillus> seems like procedure-result-arity is kinda dumb though :P
<williewillus> > (procedure-result-arity (lambda (x) (values 1 x)))
<williewillus> #f
leah2 has quit [Ping timeout: 240 seconds]
leah2 has joined #racket
ur5us has quit [Ping timeout: 248 seconds]
badkins has joined #racket
greaser|q has joined #racket
greaser|q is now known as GreaseMonkey
badkins has quit [Ping timeout: 265 seconds]
ttree has quit [Ping timeout: 240 seconds]
kimjetwav has quit [Ping timeout: 248 seconds]
lowak has quit [Remote host closed the connection]
lowak has joined #racket
ur5us has joined #racket
notzmv has quit [Ping timeout: 240 seconds]
livoreno has quit [Ping timeout: 248 seconds]
m1dnight has quit [Quit: WeeChat 3.5]
m1dnight has joined #racket
badkins has joined #racket
badkins has quit [Ping timeout: 246 seconds]
ur5us has quit [Remote host closed the connection]
ur5us has joined #racket
ur5us has quit [Ping timeout: 248 seconds]
notzmv has joined #racket
badkins has joined #racket
badkins has quit [Ping timeout: 244 seconds]
badkins has joined #racket
badkins has quit [Ping timeout: 255 seconds]
badkins has joined #racket
badkins has quit [Ping timeout: 248 seconds]
ArthurStrong has quit [Ping timeout: 260 seconds]
badkins has joined #racket
badkins has quit [Ping timeout: 246 seconds]
livoreno has joined #racket
<samth> williewillus: yeah, but it does work in many useful cases
xgqt has quit [Ping timeout: 255 seconds]
xgqt has joined #racket
ArthurStrong has joined #racket
ArthurStrong has quit [Ping timeout: 260 seconds]
badkins has joined #racket
livoreno has quit [Ping timeout: 260 seconds]
jao has joined #racket
bremner has quit [Read error: Connection reset by peer]
bremner has joined #racket
winny has quit [Remote host closed the connection]
winny has joined #racket
szkl has quit [Quit: Connection closed for inactivity]
badkins has quit [Remote host closed the connection]
ttree has joined #racket
badkins has joined #racket
[deleted] has joined #racket
kimjetwav has joined #racket
badkins has quit [Remote host closed the connection]
kimjetwav has quit [Remote host closed the connection]
winny has quit [Ping timeout: 268 seconds]
winny has joined #racket
Avichi has joined #racket
<williewillus> nice!
badkins has joined #racket
morte_ has joined #racket
morte_ has quit [Ping timeout: 264 seconds]
littlebobeep has joined #racket
littlebobeep has quit [Ping timeout: 268 seconds]
badkins has quit [Remote host closed the connection]
morte_ has joined #racket
badkins has joined #racket
badkins has quit [Remote host closed the connection]
badkins has joined #racket
SunClonus has joined #racket
morte_ has quit [Ping timeout: 248 seconds]
badkins has quit [Remote host closed the connection]
SunClonus has quit [Read error: Connection reset by peer]
gproto23 has joined #racket
lagash has quit [Quit: ZNC - https://znc.in]
rito_ has joined #racket
<kengruven> how do you test if a value passes a contract? i was sure i saw a function for that but i can't find it today.
lagash has joined #racket
<samth> kengruven: for flat contracts, you can just call them like functions
<samth> kengruven: for higher-order contracts, you can't test them
<kengruven> huh. that seems unfortunate.
<samth> kengruven: it's in principle impossible -- you can't check if a function always returns a number
ur5us has joined #racket
Algernon69 has joined #racket
twosuns has joined #racket
<kengruven> i think i'm missing something. don't contracts on function args test the contract against the passed args?
winny has quit [Remote host closed the connection]
ur5us has quit [Ping timeout: 248 seconds]
<samth> kengruven: yes. You can _apply_ a contract to a function (see the `contract` form) but that doesn't _check_ that the function will pass the contract right then. It produces a new function that does the checking.
<kengruven> right, it checks one value against one contract. that's all i'm looking for.
<samph> You could test a contract applied to a function by calling it with "bad" input or having it produce a "bad" output.
<samph> it == contracted function
<samth> kengruven: if you have a function f, and a contract like `(-> integer? integer?)` you can apply the contract to the function, which gives you a new function. is that what you want?
winny has joined #racket
<kengruven> no, i think i'm doing a bad job of explaining.
twosuns has quit [Quit: Leaving]
twosuns has joined #racket
twosuns has quit [Remote host closed the connection]
winny has quit [Remote host closed the connection]
winny has joined #racket
<kengruven> oh, maybe flat-contract-predicate is what i was thinking of.
ur5us has joined #racket
winny has quit [Remote host closed the connection]
winny has joined #racket
winny has quit [Remote host closed the connection]
ur5us has quit [Quit: Leaving]
winny has joined #racket
Algernon69 has quit [Ping timeout: 260 seconds]
ur5us has joined #racket
rito_ has quit [Ping timeout: 256 seconds]
lowak has quit [Ping timeout: 268 seconds]
lowak has joined #racket
gproto23 has quit [Remote host closed the connection]
badkins has joined #racket
badkins has quit [Ping timeout: 246 seconds]
Avichi has quit [Ping timeout: 252 seconds]
wwalker_ is now known as wwalker