#racket

/

      • FreeFull joined the channel
      • montanonic joined the channel
      • badkins joined the channel
      • jeapostrophe joined the channel
      • cpup has quit
      • jeapostrophe has quit
      • shdeng joined the channel
      • rekahsoft` has quit
      • cemerick joined the channel
      • jeapostrophe joined the channel
      • jeapostrophe has quit
      • jeapostrophe joined the channel
      • jeapostrophe has quit
      • cpup joined the channel
      • mceier joined the channel
      • jshjsh joined the channel
      • jshjsh is now known as JoshS
      • ASau has quit
      • ASau joined the channel
      • jeapostrophe joined the channel
      • jeapostrophe has quit
      • jeapostrophe joined the channel
      • tmtwd joined the channel
      • cpup has quit
      • jeapostrophe has quit
      • cpup joined the channel
      • bocaneri joined the channel
      • _apg has quit
      • pilne has quit
      • jao has quit
      • rekahsoft joined the channel
      • ArneBab joined the channel
      • ArneBab has quit
      • ArneBab joined the channel
      • ArneBab_ has quit
      • tmtwd joined the channel
      • jeapostrophe joined the channel
      • montanonic joined the channel
      • badkins has quit
      • jeapostrophe has quit
      • jshjsh joined the channel
      • JoshS has quit
      • plll joined the channel
      • jshjsh is now known as JoshS
      • plll has quit
      • ASau has quit
      • jeapostrophe joined the channel
      • jeapostrophe has quit
      • endobson joined the channel
      • winny
        how do I set up drracket from git to develop from -- I think it's pulling in units from my system install instead of what's in git.
      • asumu
        winny: if you have it installed normally, you should be able to do `raco pkg update --clone`
      • `raco pkg update --clone drracket` I mean.
      • winny
        even with the system pkg installed?
      • what about raco pkg link btw ?
      • asumu
        You don't need to use it AFAIK. And yes, if by system pkg you mean the version that came with your Racket.
      • winny
        yes, i mean that
      • asumu
        Yeah it should work. You might need to use the -u flag? (I usually don't, but I install racket from git so it may be different)
      • winny
        unrelated question: in the class form, how do i call a method during init?
      • asumu
        winny: just call the method like a function in the body of the class.
      • winny
        anywhere?
      • asumu
        It gets executed in the order that you write it in the class body.
      • winny
        ah, so the class body is the init itself
      • everything is bound, so on and so forth
      • asumu
        rudybot: (define c% (class object% (super-new) (define/public (m s) (displayln s)) (m "hi") (m "hi 2")))
      • rudybot
        asumu: your sandbox is ready
      • asumu
        rudybot: (new c%)
      • rudybot
        asumu: error: with-limit: out of time
      • asumu: error: c%: undefined; <NEWLINE> cannot reference an identifier before its definition <NEWLINE> in module: 'program
      • asumu
        Oh, I don't think it saw the def.
      • rudybot: (define c% (class object% (super-new) (define/public (m s) (displayln s)) (m "hi") (m "hi 2")))
      • rudybot
        asumu: Done.
      • asumu
        rudybot: (new c%)
      • rudybot
        asumu: ; Value: (object:c%)
      • asumu: ; stdout: "hi\nhi 2\n"
      • winny
        neat!
      • rekahsoft has quit
      • jeapostrophe joined the channel
      • jshjsh joined the channel
      • JoshS has quit
      • jshjsh is now known as JoshS
      • jeapostrophe has quit
      • nomicflux has quit
      • Sergi` joined the channel
      • jeapostrophe joined the channel
      • khj joined the channel
      • jeapostrophe has quit
      • jeapostrophe joined the channel
      • jeapostrophe has quit
      • tmtwd joined the channel
      • ASau joined the channel
      • MolluskEmpire joined the channel
      • within a class body, how do i use a class method with map/curry/etc
      • I've been doing (lambda (v) (my-instance method v))
      • nyaacarD
        if that works, then i suppose so should (curry my-instance method)
      • winny
        rudybot: #f
      • rudybot
        winny: your sandbox is ready
      • winny: ; Value: #f
      • montanonic joined the channel
      • winny
        rudybot: (define c% (class object% (super-new) (define/public (m s) (displayln s)) (for-each m '(1 2 3)))
      • rudybot
        winny: (displayln args)
      • winny
        rudybot: (new %c)
      • rudybot
        winny: error: %c: undefined; <NEWLINE> cannot reference an identifier before its definition <NEWLINE> in module: 'program
      • winny
        oops
      • rudybot: (define c% (class object% (super-new) (define/public (m s) (displayln s)) (for-each m '(1 2 3))))
      • rudybot
        winny: error: eval:1:84: class: misuse of method (not in application) <NEWLINE> in: m
      • winny
        rudybot: (define c% (class object% (super-new) (define/public (m s) (displayln s)) (for-each (lambda (v) (m v)) '(1 2 3))))
      • asumu
        Unfortunately you can't use a method as a first-class value.
      • rudybot
        winny: Done.
      • winny
        yeah
      • asumu
        (I mean without the lambda)
      • winny
        indeed
      • anybody want to give me some comments on this little code snippet -- probably my first class that does anything mildly interesting: https://gist.github.com/winny-/6690c2a4738fba34...
      • lexi-lambda
        it seems a little needlessly imperative at a cursory glance
      • winny
        this is basically how i did it in java
      • i am uncertain how to make it less imperative
      • lexi-lambda
        yeah, I would probably not use the class system for something like this; it seems a bit overkill
      • winny
        yeah, that seems like a fair assessment
      • lexi-lambda
        I think you could make it less imperative by turning the game state into an immutable struct and turning the methods into ordinary functions that return new game states
      • winny
        and have predicates for testing if it's a win or tie
      • lexi-lambda
        yeah
      • winny
        btw, i am using match, is it possible to test if it's a list of the same value and that value isn't false?
      • right now I have: [(list a a a) (and a ...)]
      • i'd prefer to test if a is truthy in the pattern body
      • lexi-lambda
        you could do (list (and (not #f) a) a a)
      • winny
        that appears to be the most concise way
      • nyaacarD
        match can do that too :o
      • i would've thought to first write (list #f a a) in a match followed by (list a a a)
      • keemyb has quit
      • winny
        so the a in (and (not #f) a) and the enclosing pattern are the same a?
      • lexi-lambda
        yes
      • winny
        thanks - im going to keep the original code i posted because it appears easier to read
      • CyL has quit
      • putting everything in the match seems much more elegant overall, though
      • jeapostrophe joined the channel
      • jeapostrophe has quit
      • jeapostrophe joined the channel
      • jeapostrophe has quit
      • daemoz has quit
      • CyL joined the channel
      • tmtwd joined the channel
      • ARCADIVS joined the channel
      • Rishav joined the channel
      • Rishav
        Hi. I am a beginner and wanted to create a toy language. I want the compiler backend to be LLVM. does Racket compiles down to/transpiles to/emits LLVM IR?
      • tilpner
        Not by itself, though there may be bindings you could use
      • jshjsh joined the channel
      • JoshS has quit
      • jshjsh is now known as JoshS
      • Rishav
        @JoshS any link or article that I can read for this?
      • endobson has quit
      • sorry, meant @tilpner