zenspider
2017-7-13 14:25:11

@robby I’m starting a lang from scratch and not looking at my previous code to see how much I’m getting… I spent way too long last night trying to debug “can’t find a hole in this expr”, which blows out compilation and thus prevents any exploration in the repl. Are there strategies for this (besides “get more sleep”). Something more to the effect of “I can’t even see v” vs “can’t find a hole” would help, but are there hints or tips?


robby
2017-7-13 14:27:09

I’m not familiar with that error message


robby
2017-7-13 14:27:46

Are you seeing something like the error message this program produces?


robby
2017-7-13 14:27:48
#lang racket
(require redex)

(define-language Q
  (E ::=
     (+ e e)
     hole))

(define r
  (reduction-relation
   Q
   (--> (in-hole E (+ 1 2))
        (in-hole E 3))))

mflatt
2017-7-13 15:10:51

Dinner at 6:00pm this evening, here’s a map https://goo.gl/maps/xo8BXvjfAPJ2 – expect to spend about 30 minutes to get from the TRAX station near the dorm to the restaurant, and we’ll end a little early today


zerusski
2017-7-13 15:12:27

I think that’s M expressing some strong opinions re types

https://www.youtube.com/watch?v=JBmIQIZPaHY


haroldcarr
2017-7-13 15:45:02

extracurricular things to do : music and mountains

Thursday July 13 8pm – 11pm Alan Michael Band (jazz saxophonist from New York, my wife plays in this band) The Garage on Beck http://www.garageonbeck.com/directions

Saturday July 15 NOON–6pm Cirque Series Race (mountain race — or hike) Alta, Utah https://www.facebook.com/events/688612277988942/

Saturday July 15 6:30pm – 8:30pm Better Off With The Blue (blues band - I play bass in this band) Feldman’s Deli http://www.feldmansdeli.com/home

Saturday July 15 9:30pm – 12:30am Alan Michael Band (I will be subbing on bass) https://www.utahbayou.com/location


jack
2017-7-13 16:17:05

@jack has joined the channel


zenspider
2017-7-13 16:19:52

twisol
2017-7-13 16:26:06

Isn’t this a kind of antisyntactic thing, like was mentioned in the talk yesterday afternoon? You can’t even tell what define or quote are until you’re about to run them


twisol
2017-7-13 16:26:16

(No value judgment here, just observation)


shu--hung
2017-7-13 16:30:10

well, when we compile them (in Racket), I guess


shu--hung
2017-7-13 16:31:04

that happens when ‘compiler’ runs the compile-time function at least at runtime that .. we know them


zenspider
2017-7-13 16:37:13

@joergen7 here:

(define-syntax (hello stx)
  (syntax-parse stx
    [(_ id:id) #'(define id 'world)]
    [(_ (quote id:id)) #'(hello id)]))
(hello 'y)
y

mflatt
2017-7-13 16:39:08

@twisol A difference is that the scope of redefinitions is well-defined, so while quote may be redefined within a module, there’s no way to change the meaning of quote in any existing module (without changing that module or something that it imports)


twisol
2017-7-13 16:39:29

Ahh, that makes sense. Thanks!


zenspider
2017-7-13 16:40:21

at some point I need to really understand the full power of the modules (esp submodules)… instantiation for example seems like voodoo and I have yet to find good doco for it


zenspider
2017-7-13 16:41:54

@mflatt eg… this required a lot of help from you to dynamically create and instantiate a module: https://gist.github.com/zenspider/6c4e50cdea9925f706ac1ff0019e3105


zenspider
2017-7-13 16:41:55

zenspider
2017-7-13 16:42:24

I don’t know if that implies missing (or confusing) doco or a missing function/macro


twisol
2017-7-13 16:52:44

“It’s hard, unlike types!” :smile:


johnazariah
2017-7-13 18:09:31

so will the canonical solutions to all the exercises be made available somewhere?


sorawee
2017-7-13 19:32:43

@sorawee has joined the channel


haroldcarr
2017-7-13 20:39:15

Hello @robby

In the language I am modeling, recusive function definitions are stated:

 (rec x (λ (x) e))

and reduced via:

(—> (prog Π (in-hole E ((rec x_1 (λ (x_2) e_1)) v_1))) (prog Π (in-hole E ((λ (x_2) e_2) v_1))) (where e_2 (subst [((rec x_1 (λ (x_2) e_1)) x_1)] e_1))

QUESTION: Is it possible to state that the body e refers to both x_1 and x_2?

#:binding-forms (rec x_1 (λ (x_2) e #:refers-to x_2)) ;; AND e #:refers-to x_1


robby
2017-7-13 20:44:52

@haroldcarr use shadow


robby
2017-7-13 20:45:09

#:refers-to (shadow x_1 x_2)


robby
2017-7-13 20:45:36

(or maybe in the other order; try it out to see which one should count as the inner binding)


haroldcarr
2017-7-13 20:46:56

the intuition I get from the name shadow does not match what I am trying to do. I want e to refer to BOTH x_1 and x_2 — and those two vars should be unique.


haroldcarr
2017-7-13 20:47:45

I looked up the redex doc for shadow - does not give any info.


haroldcarr
2017-7-13 20:48:47

Spoke too soon - I see more info on shadow - but still not clear.


zenspider
2017-7-13 21:00:42

@haroldcarr look up at yesterday’s convo… there was a code sample (inline) that may help


haroldcarr
2017-7-13 21:06:56

my understanding now is: e #:refers-to (shadow x_1 x_2) says e should refer to ALL the variables mentions in shadow - and if any of the variables have the same name, pick the leftmost one. Right?


tov
2017-7-13 21:09:04

@haroldcarr : correct


florence
2017-7-13 21:51:52

dan
2017-7-13 22:03:37

zerusski
2017-7-14 02:16:03

could anyone send me a map location? Lost u near the temple


zenspider
2017-7-14 06:59:59

redex-match says “The procedure accepts a single term and returns #f or a list of match structures describing the matches.” but that seems false:

    (test-equal (redex-match Lambda (if #f e_1 e_2) e13)
                (term (list (match (list (bind 'e_1 1) (bind 'e_2 2))))))

produces:

  actual: (list (match (list (bind 'e_1 1) (bind 'e_2 2))))
expected: '(list (match (list (bind 'e_1 1) (bind 'e_2 2))))

?? how to write a test using test-equal and test-equal? Or what’s the proper alternative? I basically want to do the part Robby suggested where you start up at e and go down in pattern or remove part of the term until it matches the way you think it should.