pocmatos
2018-6-25 07:09:38

@notjack can’t seem to reproduce the issue. Maybe it depends on the libraries you use?


pocmatos
2018-6-25 07:09:52

Nonetheless, feel free to use another image if it solves your problem.


samth
2018-6-25 13:14:58

@krismicinski I don’t think there’s been much work on that


samth
2018-6-25 13:15:35

There’s some code to check that in the optimizer, of course, as well as in the linklet extractor in the expander


hunter.t.joz
2018-6-25 13:35:25

Who do I report to about the lack of accessibility with screen readers and dr. Racket?


samth
2018-6-25 13:41:10

@hunter.t.joz you can report issues on http://github.com/racket/racket\|github.com/racket/racket, @leif is likely to know more about screen reader use


jerome.martin.dev
2018-6-25 14:24:44

@hunter.t.joz Some weeks ago I think @leif was trying to improve accessibility for screen readers, as far as I know.


abmclin
2018-6-25 17:36:40

A question about flat contracts, in my particular scenario I need to make sure flat contracts can be directly used as functions since they may be plain Racket values pulling double-duty so I check to see if they satisfy procedure? or not and report an error accordingly. I wasn’t happy with that so I was poking around the documentation and found flat-contract-predicate which would allow me to handle all flat contracts the same way. The accompanying note warning it exists for backward compatibility gave me pause. Is there a better way to cope with flat contracts that may be predicate procedures or not? Basically I’d like to take arbitrary flat contracts and apply them as predicates without worrying about what kind they are.


lexi.lambda
2018-6-25 17:38:53

@abmclin All flat contracts are predicates now, so you can just apply them as functions.


samth
2018-6-25 17:39:07

@lexi.lambda as @abmclin notes, that’s not true


ben
2018-6-25 17:39:18

use flat-contract? and contract-first-order-passes?


lexi.lambda
2018-6-25 17:39:20

Oh, you’re right, I misinterpreted.


samth
2018-6-25 17:39:29

(flat-contract? 7) is #t


lexi.lambda
2018-6-25 17:39:43

There’s a way to coerce something to a contract, right? Does that do the right thing here?


samth
2018-6-25 17:39:46

I think those docs should just be changed


ben
2018-6-25 17:40:03

coerce-flat-contract


lexi.lambda
2018-6-25 17:40:18

Does coerce-flat-contract produce a procedure when given a literal?


abmclin
2018-6-25 17:40:31

agreed, one section encourages you to use flat-contract-predicate while another section seems to say beware, so that function would be so useful so would be nice if it was more blessed


lexi.lambda
2018-6-25 17:41:29

It looks like coerce-flat-contract doesn’t do what you want; it passes non-procedures through unchanged.


samth
2018-6-25 17:41:56

no, that’s just the printer lying to you


abmclin
2018-6-25 17:42:28

I was confused by that too


abmclin
2018-6-25 17:43:07

ok it seems it is perfectly ok to use flat-contract-predicate? And just remove the note about backward compatibility as unhelpful?


samth
2018-6-25 17:47:36

that’s my feeling


abmclin
2018-6-25 17:47:42

contract-first-order-passes? looks interesting, it would simplify some of the code involved in verifying whether a contract accepts the value or not


abmclin
2018-6-25 17:48:41

the first order thing gives me heebies jeevies though, is there such a thing as second order?


ben
2018-6-25 17:51:16

nope just higher order


ben
2018-6-25 17:52:18

the idea is, if ctc is a first-order contract then (ctc v) either returns v or raises an exception … it doesn’t return some chaperoned or modified version of v


abmclin
2018-6-25 17:55:08

ah ok, and flat contracts are always first-order?


ben
2018-6-25 17:55:43

yes


ben
2018-6-25 17:56:00

I’d say, flat contracts are only first order. Chaperone contracts are first order + some other things


abmclin
2018-6-25 17:56:13

ok that was helpful, thank you


ben
2018-6-25 17:56:17

cool


ben
2018-6-25 17:56:40

(contracts like or/c use this first-order-passes check to decide what contract to apply to an incoming value) EDIT: maybe it’s only or/c? I can’t think of another


abmclin
2018-6-25 17:57:45

still interesting to know, I like the contract system a lot


abmclin
2018-6-25 18:06:15

using a conjunction of flat-contract? and contract-first-order-passes? has solved my problem and simplified some things as well so I’m happy with it.


lexi.lambda
2018-6-25 18:19:39

@samth huh


lexi.lambda
2018-6-25 18:20:29
> (coerce-flat-contract 'here 42)
42
> ((coerce-flat-contract 'here 42) 1)
#f
> (number? (coerce-flat-contract 'here 42))
#f

lexi.lambda
2018-6-25 18:22:08

I would expect contract-name to produce 42, but I did not expect it to print as 42


abmclin
2018-6-25 18:28:40

It trips me up sometimes, guess it’s a way of being helpful in telling you what values satisfy the contract


abmclin
2018-6-25 18:30:22

afterall plain values are already contract? true so it makes sense that any contract wrapper would print its underlying plain values


lexi.lambda
2018-6-25 18:31:08

I’m not sure I agree… I’d much prefer a printing style like #<flat-contract: 42>. but oh well.


abmclin
2018-6-25 18:32:31

it’s interesting how structs assume many disguises in the Racket ecosystem


lexi.lambda
2018-6-25 18:33:12

I think the model is that every value is supposed to be a “structure” with possibly opaque fields


lexi.lambda
2018-6-25 18:34:04

so it’s not so much that structures are a lot of things but that everything is a structure. (of course this isn’t actually true, but all the structure functions work on arbitrary values and treat non-structure things the same as opaque structures for this reason.)


lexi.lambda
2018-6-25 18:35:00

e.g. > (struct-info 42) #f #t


abmclin
2018-6-25 18:35:48

makes sense, I can see how that model would be convenient for attaching all kinds of metadata or functionality to any values to help support Racket’s programmable programming language features. Or at least allow values to be treated in a uniform manner.


lexi.lambda
2018-6-25 18:39:04

it looks like contracts in general print as contract-name, which usually makes sense… it just does a sort of weird thing in the case of the class of flat contracts that are represented by plain values.


leif
2018-6-25 18:40:22

@mflatt Did the way subprocess subprocesses handle io ports change in Racket 6.10?


lexi.lambda
2018-6-25 18:40:25

though that’s not entirely true… the printers installed by make-contract and friends use the #<contract: ...> convention. but it looks like the combinators from racket/contract have their own convention.


leif
2018-6-25 18:41:28

I ask because we have a program that effectively prints out a line of text and finishes, which works correctly when called from Racket 6.9 or below, but fails on 6.10 up. (Or rather, it deadlocks and the string never gets printed to the port.)


mflatt
2018-6-25 18:42:34

@leif v6.10 was the switch to rktio, so something may have gone wrong there


mflatt
2018-6-25 18:42:48

Do you have something that I can run?


leif
2018-6-25 18:44:32

Uhh….kind of, but it has a lot of odd deps.


leif
2018-6-25 18:45:04

(Trying to shrink it down now, but its written using: https://github.com/vasilisp/inez)


leif
2018-6-25 18:45:28

With this file:

open Script ;;

let x = fresh_int_var() ;;
constrain (~logic (x >= 0)) ;;


constrain (~logic (not ((0 <= (x - 1)) && ((0 = 0) && (0 = 0))))) ;;

solve_print_result();;

leif
2018-6-25 18:45:39

But its kind of complicated to set all of it up. :disappointed:


leif
2018-6-25 18:46:07

Justin Sleapak has it running on his computer.


leif
2018-6-25 18:46:15

Slepak*


leif
2018-6-25 19:52:45

@mflatt Okay, I have failed to make a program with the same problem. So Jusin is just going to package his up into a VM and send it to you. Would that work?


mflatt
2018-6-25 19:52:56

ok


shu--hung
2018-6-25 20:45:47

@abmclin @lexi.lambda @samth how about contract-first-order?


shu--hung
2018-6-25 20:46:39

oh I saw contract-first-order-passes?


abmclin
2018-6-26 00:03:27

@shu—hung yes it did the trick for me


krismicinski
2018-6-26 00:55:26

I just had a situation in which I got a strange error from Racket relating to units that went away after wiping out compiled/. Am I correct in saying that this is probably a bug? Might be tough for me to replicate and minimize but will keep in mind. It was a vector-ref contract violation, which I think means that racket units are packing things into vectors, the spec changed, but Racket was using stale code and then that was causing a contract violation.


krismicinski
2018-6-26 00:55:48

Didn’t really occur to wipe out compiled until I realized this might what was happening..


samth
2018-6-26 01:45:19

@krismicinski it’s maybe a bug but also maybe not


krismicinski
2018-6-26 02:09:03

Yeah, I don’t know enough about units or the implementation to say tbh. Probably I just should have anticipated that..


samth
2018-6-26 02:11:45

it’s almost certainly because of stale compiled files, which can cause errors


samth
2018-6-26 02:11:55

whether that error is the sign of a bug is hard to say