ziyourenxiang has joined #racket
iyzsong has joined #racket
Nikon has joined #racket
<Nikon> oh cool, people!
<Nikon> hey sorry to bother all of you, would somebody be able to give me a hand?
<Nikon> basically what i am trying to do is access the second element in a list of lists
<Nikon> so (list (list 1 2) (list 4 5) (list 9 1))
<Nikon> and i want to compare the second value to some number
<bremner> rudybot: (second (second (list (list 1 2) (list 4 5) (list 9 1))))
<rudybot> bremner: error: second: undefined; <NEWLINE> cannot reference an identifier before its definition <NEWLINE> in module: 'program
<bremner> oops.
<bremner> rudybot: init racket
<rudybot> bremner: error: with-limit: out of time
<bremner> hrm.
<bremner> Nikon: sorry, I can't make the bot demo it. But does (second (second your-list)) work for you/
<Nikon> no i need to basically check everything in the big list, keep it if y = the second entry
<Nikon> i was thinking sift
<Nikon> but i had no idea how to get it to use the list that was currently being checked
<bremner> ah, that's a specific function for a course, I'm not familiar with sift.
<Nikon> so in a nut shell, we have a list of lists, i want to go and look at the seecond value of the inner most list, and if it equals some y, then i want to keep that entry, if not i discard it
<bremner> the "entry" being the list of lists?
<Nikon> so as a first step ex: ((1 2) (3 4)) -> (1 2) -> does 2 = y? if yes continue, then (3 4) does y equal 4? if yes continue, if no remove (3 4)
<bremner> that doesn't sound like a very rackety way of describing the algorithm. Is that your problem description?
<bremner> I suspect you'd be better off trying to think about the problem recursively.
lavaflow has quit [Read error: Connection reset by peer]
<bremner> or use a for/list if that's part of your course.
<Nikon> yeah, sorry i'm helping my gf, i'm a C programmer so my algo doesnt work heh
<bremner> looking at sift, it looks like it could work
<Nikon> yeah thats what i was thinking, i just dont know how to make it evaluate like i want it to
<Nikon> because i want it to look at the list of the list its currently evaluating
<Nikon> but i'm not sure how to do that
<Nikon> like the list in the current step of map you know?
<bremner> (sift (lambda (sub-list) (condition)) list-of-lists)
<bremner> just write something appropriate for "condition"
<Nikon> ooooooo
<bremner> I've got to go, but you can try experimenting with one of your sublists to get the lambda right.
<Nikon> okay thank you!!!!
lavaflow has joined #racket
YuGiOhJCJ has quit [Ping timeout: 256 seconds]
<Nikon> hey i know bremner is gone but the check expect should look like this
<Nikon> (check-expect (row (list (point 1 2) (point 3 4) (point 2 2)) 2)
<Nikon> (local [(define (y? a-point)
<Nikon> (= (Y a-point) 2))]
<Nikon> (list (point 1 2) #;(point 3 4) (point 2 2))))
<Nikon> how do i parse that little bit of code at the end?
_whitelogger has joined #racket
Oxyd_ has joined #racket
Oxyd has quit [Ping timeout: 244 seconds]
kefin has quit [Ping timeout: 272 seconds]
orivej has quit [Ping timeout: 272 seconds]
pierpal has joined #racket
g00s has joined #racket
pierpal has quit [Read error: Connection reset by peer]
Nikon has quit [Read error: Connection reset by peer]
zigpaw has quit [Remote host closed the connection]
zigpaw has joined #racket
dented42 has joined #racket
lockywolf has joined #racket
lockywolf has quit [Remote host closed the connection]
lockywolf has joined #racket
evdubs_ has joined #racket
evdubs has quit [Ping timeout: 252 seconds]
pierpal has joined #racket
pierpal has quit [Read error: Connection reset by peer]
lockywolf_ has joined #racket
pierpal has joined #racket
lockywolf has quit [Ping timeout: 252 seconds]
pierpal has quit [Ping timeout: 252 seconds]
lockywolf_ has quit [Remote host closed the connection]
lockywolf_ has joined #racket
g00s has quit [Quit: Textual IRC Client: www.textualapp.com]
pierpal has joined #racket
pera has quit [Ping timeout: 240 seconds]
lockywolf_ has quit [Remote host closed the connection]
dented42 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
lockywolf_ has joined #racket
lockywolf_ has quit [Remote host closed the connection]
lockywolf has joined #racket
NB0X-Matt-CA has quit [Ping timeout: 244 seconds]
rudybot has quit [Ping timeout: 244 seconds]
niceplace has quit [Ping timeout: 244 seconds]
rudybot has joined #racket
NB0X-Matt-CA has joined #racket
niceplace has joined #racket
tcsc has quit [Ping timeout: 252 seconds]
tcsc has joined #racket
tilpner has quit [Quit: :wq]
tilpner has joined #racket
georges-duperon has joined #racket
dan_f has quit [Quit: dan_f]
lockywolf has quit [Quit: Leaving]
lockywolf has joined #racket
lockywolf has quit [Remote host closed the connection]
phf_f334 has joined #racket
lockywolf has joined #racket
lockywolf_ has joined #racket
orivej has joined #racket
lockywolf has quit [Ping timeout: 250 seconds]
<phf_f334> Hello! Is there a way to parameterize a module instance? The intent is to have procedures in "utils.rkt" to take into account a context. Here is a gist: https://gist.github.com/phfrohring/05047aba1a5cfb50adf6f5078be2ae27 Thank you!
audriu has joined #racket
lockywolf__ has joined #racket
soegaard has joined #racket
lockywolf_ has quit [Ping timeout: 264 seconds]
rand__ has joined #racket
lockywolf__ has quit [Remote host closed the connection]
lockywolf__ has joined #racket
cpup has quit [Ping timeout: 264 seconds]
cpup has joined #racket
pie_ has quit [Ping timeout: 252 seconds]
lockywolf__ has quit [Read error: Connection reset by peer]
lockywolf has joined #racket
Oxyd_ is now known as Oxyd
rand__ has quit [Ping timeout: 264 seconds]
phf_f334 has left #racket ["ERC (IRC client for Emacs 26.1)"]
vraid has quit [Ping timeout: 256 seconds]
lockywolf has quit [Read error: Connection reset by peer]
lockywolf has joined #racket
audriu has quit [Remote host closed the connection]
lockywolf has quit [Ping timeout: 276 seconds]
iyzsong-x has joined #racket
iyzsong has quit [Ping timeout: 252 seconds]
dustyweb has quit [Read error: Connection reset by peer]
kefin has joined #racket
iyzsong-x has quit [Ping timeout: 240 seconds]
pierpal has quit [Quit: Poof]
pierpal has joined #racket
soegaard has quit [Quit: soegaard]
pie_ has joined #racket
pierpal has quit [Ping timeout: 244 seconds]
nyaacarD has quit [Remote host closed the connection]
johnjay has joined #racket
soegaard has joined #racket
acarrico has joined #racket
dddddd has joined #racket
kefin has quit [Ping timeout: 246 seconds]
pierpal has joined #racket
pierpal has quit [Read error: Connection reset by peer]
pierpal has joined #racket
ziyourenxiang has quit [Ping timeout: 246 seconds]
dan_f has joined #racket
Welkin has joined #racket
pie_ has quit [Remote host closed the connection]
pie_ has joined #racket
pierpal has quit [Ping timeout: 244 seconds]
hz has joined #racket
pierpal has joined #racket
Welkin has quit [Quit: leaving]
kefin has joined #racket
pierpal has quit [Ping timeout: 240 seconds]
ZombieChicken has joined #racket
pera has joined #racket
nyaacarD has joined #racket
ym has quit [Quit: Leaving]
soegaard has quit [Quit: soegaard]
pierpal has joined #racket
pierpal has quit [Read error: Connection reset by peer]
soegaard has joined #racket
vraid has joined #racket
johnjay has quit [Ping timeout: 256 seconds]
benner has joined #racket
georges-duperon has quit [Ping timeout: 252 seconds]
Welkin has joined #racket
pierpal has joined #racket
pierpal has quit [Read error: Connection reset by peer]
Welkin has quit [Ping timeout: 246 seconds]
pierpal has joined #racket
pierpal has quit [Read error: Connection reset by peer]
Welkin has joined #racket
pierpal has joined #racket
dented42 has joined #racket
pierpal has quit [Read error: Connection reset by peer]
dented42 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rand__ has joined #racket
SenasOzys has joined #racket
SenasOzys has quit [Client Quit]
hz has quit [Read error: Connection reset by peer]
georges-duperon has joined #racket
ubLIX has joined #racket
pera has quit [Ping timeout: 240 seconds]
rand__ has quit [Ping timeout: 246 seconds]
libertyprime has joined #racket
pera has joined #racket
Welkin has quit [Quit: leaving]
Nyanraltotlapun has joined #racket
<winny> i've been using racket for quite awhile, and still don't quite follow the "racket-way" to make your own languages via transforming the syntax then defining your own s-expression based language. Is there a terse guide about this besides beautiful racket?
<winny> rather, i guess what has me tied up is the best way to define a reader that isn't related to racket syntax in any way
* winny crosses fingers and hopes to make racket school 2019
<rain2> you can do it using my peg parser winny
<winny> :) i'd enjoy reading it
<winny> i just remembered there is the paper that uses MiniJava which seems a bit more consumable
<rain2> https://github.com/rain-1/nand-lang here's an example
<winny> this is probably not a good idea, but is there a lex/yacc like for racket
<soegaard> winny: yes, the parser-tools collection has a lex/yacc style parser. It works great. http://docs.racket-lang.org/parser-tools/index.html?q=lex
<rain2> it has hygiene issues
<winny> a long term project is to implement a scheme (probably r5rs-like), maybe i'll do it in racket
<soegaard> rain2: what do you mean?
<winny> though i've been toying with doing it is some really weird language
<winny> hm, if i ever get my blog off the ground maybe i'll write a survey on tokenizing/parsing libraries..
<winny> aha:D
<rain2> you can edit this page if you like
<winny> thanks
<winny> rain2: so how many rains are there ;)
<soegaard> rain2: brag/issues/3 doesn't mention the parser-tools library - only ragg and brag
<winny> i noticed in the back of the 'unix programming environment' there is a language called hoc, seems like a good one to try these tools with
<winny> rain2: if anything it'd probably be more anecdotal (I found this easy because it has these features, sort of thing)
<rain2> that sort of stuff is a big help for people picking a library
<winny> library selection is a big challenge in racket honestly
<winny> i agree
<winny> indeed, it seems parser-tools is probably the most familiar to me
<winny> (given previous experience with lex/yacc)
<winny> is there a recommended paper or resource other than wikipedia about PEG
<winny> I'm assuming this perhaps - https://dl.acm.org/citation.cfm?id=964001.964011
<soegaard> Look at mini-pascal-lexer.rkt and mini-pascal-grammar.rkt if you need a longer example: https://github.com/soegaard/minipascal/tree/master/minipascal
<soegaard> It uses parser-tools.
zv has joined #racket
<rain2> for PEG it's really just regex + recursion
<winny> so it can't recognize non-regular languages?
<rain2> it can, because of the addition of recursion
<winny> I'm not certain if that made sense, my one semester exposure to the subject could use some self-study
<rain2> it's kind of close of CFG but it doesn't fit exactly into one of these standard classes, because it picks a less theoretically pure but more pragmatically useful option of left biasing alternation
<rain2> in terms of parsing programming languages this choice is pragmatic because it lets you do things like dangling else
<winny> interesting. I'm sure this paper will describe that too
soegaard has quit [Quit: soegaard]
YuGiOhJCJ has joined #racket
<winny> so my understanding is PEG gives you two things: (1) lookahead-like checking on the grammar (2) a simpler way to encode precedence and alternate syntaxes
<winny> oh and less ambiguity with greedy matching
<rain2> yeah and it also has semantic actions
<rain2> so you can put minor AST transformations into the parser source code itself
<winny> is that a kind of extension to the original work (ford 2004)?
<rain2> I think that it did come a bit later, not certain
<rain2> that idea can be taken much further with attribute grammars
calwoo has joined #racket
<Nyanraltotlapun> Hi, ffi question, what exactly happening when I call some math function (for example bitwise-xor) on ctype(_uint64)? Performance wise...
<Nyanraltotlapun> I am trying to write some efficient bytestring comparison, and the idea to get cpointer to bytestring and use it as _uint64 reference
georges-duperon has quit [Ping timeout: 272 seconds]
YuGiOhJCJ has quit [Ping timeout: 256 seconds]
lavaflow has quit [Read error: Connection reset by peer]
lavaflow has joined #racket
ziyourenxiang has joined #racket
calwoo has quit [Ping timeout: 246 seconds]
acarrico has quit [Ping timeout: 252 seconds]
acarrico has joined #racket
acarrico has quit [Ping timeout: 240 seconds]
kefin has quit [Read error: Connection reset by peer]
calwoo has joined #racket