<tjgillies>
would be cool if i could do that in ruby
bigwillystyle has left #ruby-lang [#ruby-lang]
dhruvasagar has quit [Ping timeout: 264 seconds]
<oddmunds>
tjgillies: do you know blocks in ruby?
<tjgillies>
yes
<tjgillies>
im wonderin if theres already a library
dillyjay_ has joined #ruby-lang
<oddmunds>
ok. then i probably misunderstood your question.
dhruvasagar has joined #ruby-lang
chendo has quit [Ping timeout: 245 seconds]
<drbrain>
sounds more like AREL
<oddmunds>
tjgillies: you want the sql-like syntax from linq?
<tjgillies>
yes
<tjgillies>
but query data structures
<drbrain>
doesn't datamapper 2 have something liker his too?
dillyjay_ has quit [Client Quit]
rwk1 has joined #ruby-lang
* tjgillies
finds it ironic he pased a lisp file then was asked if he knew about "blocks"
<tjgillies>
s/pased/pasted/
<oddmunds>
tjgillies: yeah, i meant in ruby
<oddmunds>
stuff have different names and different usages in different languages and places
<oddmunds>
just like i thought you meant something else when you spoke of something like linq
<tjgillies>
ive never used linq
<tjgillies>
i just know thats what people talk about when they talk about the concepts im thinking about
<tjgillies>
so i kind cargo culted that one
<tjgillies>
s/kind/kinda/
<oddmunds>
i use the lambda-like expressions when i use linq (probably because i'm used to using blocks in ruby)
emocakes has quit [Quit: emocakes]
<oddmunds>
tjgillies: that syntax reminds me a little of the loop syntax in common lisp
rwk1 has quit [Ping timeout: 246 seconds]
rockpapergoat has joined #ruby-lang
lokaum182 has joined #ruby-lang
quazimodo has quit [Ping timeout: 246 seconds]
emocakes has joined #ruby-lang
rockpapergoat has quit [Remote host closed the connection]
quazimodo has joined #ruby-lang
symm- has quit [Ping timeout: 255 seconds]
amerine has quit [Ping timeout: 255 seconds]
ros3bud has quit [Remote host closed the connection]
fosky has quit [Remote host closed the connection]
apeiros_ has quit [Remote host closed the connection]
pkrnj has joined #ruby-lang
brianpWins has joined #ruby-lang
tcopp has joined #ruby-lang
pr0ton has joined #ruby-lang
soknee has joined #ruby-lang
fosky has joined #ruby-lang
soknee has quit [Client Quit]
voker57 has joined #ruby-lang
voker57 has quit [Changing host]
voker57 has joined #ruby-lang
singpolyma has quit [Quit: Lost terminal]
idkazuma has quit [Remote host closed the connection]
soknee has joined #ruby-lang
pr0ton has quit [Quit: pr0ton]
thorncp has left #ruby-lang [#ruby-lang]
soknee has quit [Client Quit]
soknee has joined #ruby-lang
soknee has quit [Client Quit]
tcopp has quit [Ping timeout: 264 seconds]
brianpWins has quit [Quit: brianpWins]
stevechiagozie has joined #ruby-lang
chendo has joined #ruby-lang
chendo has quit [Client Quit]
rwk1 has joined #ruby-lang
tylersmith has quit [Quit: tylersmith]
apeiros_ has joined #ruby-lang
postmodern has quit [Quit: Leaving]
postmodern has joined #ruby-lang
apeiros_ has quit [Read error: Operation timed out]
pkrnj has quit [Quit: Computer has gone to sleep.]
dhruvasagar has quit [Ping timeout: 256 seconds]
charliesome has joined #ruby-lang
emocakes has quit [Quit: emocakes]
ryanf has quit [Quit: leaving]
ryanf has joined #ruby-lang
ryanf has quit [Client Quit]
ryanf has joined #ruby-lang
jonahR has joined #ruby-lang
rwk1 has quit [Read error: Connection timed out]
amerine has joined #ruby-lang
dhruvasagar has joined #ruby-lang
ndch has joined #ruby-lang
lsegal` has joined #ruby-lang
kain_ has joined #ruby-lang
shachaf_ has joined #ruby-lang
r0bglees0n has joined #ruby-lang
shachaf_ has quit [Changing host]
shachaf_ has joined #ruby-lang
ParkQ has joined #ruby-lang
shachaf has quit [Disconnected by services]
jasiek_ has joined #ruby-lang
shachaf_ is now known as shachaf
faces has joined #ruby-lang
voker57_ has joined #ruby-lang
mbr_ has joined #ruby-lang
zygen_ has joined #ruby-lang
emocakes has joined #ruby-lang
znz_v0 has joined #ruby-lang
voker57 has quit [*.net *.split]
lsegal has quit [*.net *.split]
zavier has quit [*.net *.split]
r0bgleeson has quit [*.net *.split]
kain has quit [*.net *.split]
kvs has quit [*.net *.split]
adam12 has quit [*.net *.split]
face has quit [*.net *.split]
znz_v has quit [*.net *.split]
zygen has quit [*.net *.split]
mbr has quit [*.net *.split]
jasiek has quit [*.net *.split]
d_roge has quit [*.net *.split]
ndch has quit [Remote host closed the connection]
sailias has quit [Quit: Leaving.]
techlife has quit [Ping timeout: 264 seconds]
Gaelan has joined #ruby-lang
rwk1 has joined #ruby-lang
d_roge has joined #ruby-lang
adam12 has joined #ruby-lang
kvs has joined #ruby-lang
stevechiagozie has quit [Quit: Computer has gone to sleep.]
dhruvasagar has quit [Ping timeout: 252 seconds]
zavier has joined #ruby-lang
techlife has joined #ruby-lang
rwk1 has quit [Remote host closed the connection]
pkrnj has joined #ruby-lang
rippa has joined #ruby-lang
ndch has joined #ruby-lang
Gaelan has quit [Remote host closed the connection]
ParkQ has quit [Remote host closed the connection]
Gaelan has joined #ruby-lang
Gaelan has quit [Remote host closed the connection]
Gaelan has joined #ruby-lang
megha has joined #ruby-lang
baba has quit [Ping timeout: 240 seconds]
dhruvasagar has joined #ruby-lang
havenwood has quit [Remote host closed the connection]
dhruvasagar has quit [Ping timeout: 260 seconds]
srbaker has joined #ruby-lang
singpolyma has joined #ruby-lang
<lewis1711>
what's the issue? ruby has the equivalent of loads of HOF's on lists. just chain them together
srbaker has quit [Quit: Computer has gone to sleep.]
<lewis1711>
tjgillies: "filter" is called "find_all" or "select" in ruby, mapping cons over two lists is the zip method. do you have a specific question?
<tjgillies>
lewis1711: i was looking specifically for a datalog implementation in ruby
amerine has quit [Quit: Computer has gone to sleep.]
srbaker has joined #ruby-lang
srbaker has quit [Client Quit]
amerine has joined #ruby-lang
idkazuma has joined #ruby-lang
sandbags has quit [Remote host closed the connection]
havenwood has joined #ruby-lang
wallclockbuilder has joined #ruby-lang
wallcloc_ has joined #ruby-lang
tcopp has joined #ruby-lang
ezkl has joined #ruby-lang
wallclockbuilder has quit [Read error: Connection reset by peer]
wallcloc_ has quit [Read error: Connection reset by peer]
wallclockbuilder has joined #ruby-lang
wallcloc_ has joined #ruby-lang
kith_ has joined #ruby-lang
kith has quit [Read error: Operation timed out]
wallclockbuilder has quit [Ping timeout: 264 seconds]
arooni-mobile has quit [Ping timeout: 245 seconds]
thorncp has joined #ruby-lang
aj_acevedo has joined #ruby-lang
OrangeCrush has joined #ruby-lang
glebm has quit [Quit: Computer has gone to sleep.]
drumond19 has joined #ruby-lang
srbaker has joined #ruby-lang
Gaelan has quit [Remote host closed the connection]
OrangeCrush has quit [Quit: leaving]
Nisstyre-laptop has joined #ruby-lang
sonots has joined #ruby-lang
srbaker has quit [Client Quit]
ykk has quit [Remote host closed the connection]
kgrz has joined #ruby-lang
dhruvasagar has joined #ruby-lang
retro|cz has joined #ruby-lang
Gaelan has joined #ruby-lang
tcopp has quit [Ping timeout: 256 seconds]
sush24 has joined #ruby-lang
ritek has quit [Ping timeout: 245 seconds]
ritek has joined #ruby-lang
ritek has quit [Ping timeout: 245 seconds]
ritek has joined #ruby-lang
aj_acevedo has quit [Quit: Leaving.]
emocakes has quit [Quit: emocakes]
kgrz has quit [Quit: Computer has gone to sleep.]
kain_ has quit [Quit: exit]
breakingthings has quit []
aj_acevedo has joined #ruby-lang
tomzx_mac has quit [Ping timeout: 258 seconds]
idkazuma has quit [Remote host closed the connection]
Polish_ has joined #ruby-lang
ritek has quit [Ping timeout: 245 seconds]
fosky has quit [Ping timeout: 240 seconds]
havenwood has quit [Ping timeout: 260 seconds]
ritek has joined #ruby-lang
aj_acevedo has quit [Quit: Leaving.]
havenwood has joined #ruby-lang
brianpWins has joined #ruby-lang
<lewis1711>
"Nokogiri::XML::Node is your window to the fun filled world of dealing with XML and HTML tags." they're not kidding
Gaelan has quit [Remote host closed the connection]
mistym has quit [Remote host closed the connection]
mytrile has joined #ruby-lang
jerrytgarcia has quit [Client Quit]
bryno has quit [Quit: leaving]
ndch has quit [Quit: Leaving...]
bri has joined #ruby-lang
shirokuro11 has joined #ruby-lang
swav has joined #ruby-lang
dhruvasagar has joined #ruby-lang
tbuehlmann has joined #ruby-lang
tonni has quit [Remote host closed the connection]
tonni has joined #ruby-lang
tonni_ has joined #ruby-lang
tonni__ has joined #ruby-lang
tonni has quit [Ping timeout: 264 seconds]
tonni_ has quit [Ping timeout: 252 seconds]
apeiros_ has joined #ruby-lang
amerine has quit [Quit: Computer has gone to sleep.]
arooni-mobile has joined #ruby-lang
sush24 has quit [Quit: This computer has gone to sleep]
agile has joined #ruby-lang
ryez has joined #ruby-lang
r0bby has joined #ruby-lang
robbyoconnor has quit [Ping timeout: 245 seconds]
r0bby is now known as robbyoconnor
arooni-mobile has quit [Quit: Leaving]
dkannan has joined #ruby-lang
dkannan has quit [Read error: No route to host]
dkannan has joined #ruby-lang
thufir_ has joined #ruby-lang
<dkannan>
how do i inetgrate two eventmachine apps. eg faye and eventmachine-tail ?
<dkannan>
eh. integrate
shirokuro11 has quit [Remote host closed the connection]
<tbuehlmann>
dkannan, run them both in just one EM reactor
r0bglees0n has quit [Changing host]
r0bglees0n has joined #ruby-lang
brianpWins has quit [Quit: brianpWins]
bright_day has joined #ruby-lang
lsegal` has quit [Quit: Quit: Quit: Quit: Stack Overflow.]
tonni__ has quit [Read error: Connection reset by peer]
havenwood has joined #ruby-lang
tonni has joined #ruby-lang
bright_day has quit [Remote host closed the connection]
sandbags has joined #ruby-lang
sandbags has quit [Changing host]
sandbags has joined #ruby-lang
sandbags has quit [Remote host closed the connection]
io_syl has quit [Quit: Computer has gone to sleep.]
kain has joined #ruby-lang
kain has quit [Client Quit]
fosky has quit [Remote host closed the connection]
dc5ala has quit [Ping timeout: 260 seconds]
dc5ala has joined #ruby-lang
emocakes has joined #ruby-lang
kgrz has joined #ruby-lang
tonni has quit [Ping timeout: 260 seconds]
r0bby has joined #ruby-lang
robbyoconnor has quit [Ping timeout: 264 seconds]
Ridders24 has joined #ruby-lang
dkannan has quit [Quit: dkannan]
sepp2k has joined #ruby-lang
tonni has joined #ruby-lang
r0bby_ has joined #ruby-lang
dhruvasagar has quit [Read error: Connection reset by peer]
r0bby has quit [Ping timeout: 255 seconds]
dhruvasagar has joined #ruby-lang
idkazuma has quit [Remote host closed the connection]
r0bby_ has quit [Ping timeout: 246 seconds]
r0bby_ has joined #ruby-lang
Invac has joined #ruby-lang
thebastl has joined #ruby-lang
kgrz has quit [Read error: No route to host]
ahf has quit [Ping timeout: 256 seconds]
ryez has quit [Quit: Page closed]
kgrz has joined #ruby-lang
FlyingLeap has quit [Quit: No Ping reply in 180 seconds.]
ahf has joined #ruby-lang
ahf has joined #ruby-lang
ahf has quit [Changing host]
FlyingLeap has joined #ruby-lang
sepp2k has quit [Ping timeout: 245 seconds]
madb055 has joined #ruby-lang
techlife has quit [Ping timeout: 246 seconds]
jaimef has quit [Excess Flood]
techlife has joined #ruby-lang
madb055 has quit [Ping timeout: 246 seconds]
jaimef has joined #ruby-lang
sepp2k has joined #ruby-lang
thone_ has joined #ruby-lang
thone has quit [Ping timeout: 258 seconds]
MaddinXx has joined #ruby-lang
megha has quit [Ping timeout: 240 seconds]
Ridders24 has quit [Ping timeout: 260 seconds]
security has joined #ruby-lang
madb055 has joined #ruby-lang
Ridders24 has joined #ruby-lang
Wildhoney has joined #ruby-lang
madb055 has quit [Ping timeout: 260 seconds]
dhruvasagar has quit [Ping timeout: 246 seconds]
madb055 has joined #ruby-lang
emocakes has quit [Quit: emocakes]
vbatts has quit [Ping timeout: 245 seconds]
benanne has joined #ruby-lang
Wildhoney has quit [Ping timeout: 255 seconds]
sepp2k has quit [Remote host closed the connection]
madb055 has quit [Ping timeout: 245 seconds]
tonni_ has joined #ruby-lang
madb055 has joined #ruby-lang
tonni has quit [Ping timeout: 255 seconds]
<Ridders24>
how can I out the user data from the twitter api, Ive managed to get all the other data as shown here: http://pastebin.com/Cxm20s2r but if you look at the user data the info comes under the "user" attribute, and I don't know how to call it: http://pastebin.com/2VRGXS4P
<yorickpeterse>
I really need to start renaming a few things though, it's getting a bit confusing
madb055 has quit [Ping timeout: 260 seconds]
lele|w has quit [Read error: Connection reset by peer]
robbyoconnor has joined #ruby-lang
lele|w has joined #ruby-lang
emocakes has joined #ruby-lang
tcopp has joined #ruby-lang
r0bby_ has quit [Ping timeout: 255 seconds]
havenwood has quit [Read error: Connection reset by peer]
havenwood has joined #ruby-lang
gnufied has joined #ruby-lang
mrfelix has joined #ruby-lang
thufir_ has quit [Quit: Leaving.]
madb055 has joined #ruby-lang
soknee has joined #ruby-lang
soknee has quit [Client Quit]
vlad_starkov has joined #ruby-lang
havenwood has quit [Ping timeout: 245 seconds]
tcopp has quit [Ping timeout: 240 seconds]
jxie has quit [Quit: leaving]
lele|w has quit [Ping timeout: 246 seconds]
kvs has quit [Ping timeout: 246 seconds]
kgrz has quit [Quit: Computer has gone to sleep.]
sepp2k has joined #ruby-lang
lele|w has joined #ruby-lang
vlad_starkov has quit [Remote host closed the connection]
thebastl has quit [Remote host closed the connection]
vlad_starkov has joined #ruby-lang
gnufied has quit [Quit: Leaving.]
madb055 has quit [Ping timeout: 256 seconds]
<rue>
Ridders24: It’s just another hash.
<Ridders24>
rue: so what do I put? as ive tried ["user" "id"] and i don't get anything
mrfelix has quit [Quit: Computer has gone to sleep.]
havenwood has joined #ruby-lang
tonni_ has quit [Read error: Connection reset by peer]
vlad_sta_ has joined #ruby-lang
tonni has joined #ruby-lang
kgrz has joined #ruby-lang
vlad_starkov has quit [Ping timeout: 246 seconds]
tonni has quit [Read error: Connection reset by peer]
ykk has joined #ruby-lang
mrfelix has joined #ruby-lang
tonni has joined #ruby-lang
Technodrome has joined #ruby-lang
<Technodrome>
is there any good rib replacement?
<Technodrome>
irb*
<rue>
Ridders24: What do you imagine that does?
<apeiros_>
Technodrome: pry
<Technodrome>
ah yes , that's what its called
<Technodrome>
any others that are good?
techlife has quit [Ping timeout: 245 seconds]
XxBlakeFailxX has quit [Ping timeout: 255 seconds]
jonahR has quit [Quit: jonahR]
<Ridders24>
rue: was hoping for the user id?, ive also tried ["user"] ["id]
<Technodrome>
apeiros_: any others or is that the best one?
sonots has joined #ruby-lang
emocakes has quit [Quit: emocakes]
sonots has quit [Ping timeout: 245 seconds]
techlife has joined #ruby-lang
mixandgo has joined #ruby-lang
mixandgo has quit [Client Quit]
techlife has quit [Max SendQ exceeded]
burgestrand has joined #ruby-lang
<rue>
Ridders24: How’d that work out?
<Ridders24>
rue: still nothing
<Technodrome>
ruby review, been doing python for a long time, a normal variable declared in a class, does that become an implicit class variable?
lewis1711 has quit [Remote host closed the connection]
sailias has joined #ruby-lang
<Technodrome>
err i guess the better question would be, what is the difference between a class local variable and a class variable defined with @@ ? I can't see the difference
<lewis1711>
"page.forms_with(:action => '/post/login.php')" I don't understand this syntax.
<lewis1711>
what is => ?
Gaelan has joined #ruby-lang
stonerfish has joined #ruby-lang
stonerfish has quit [Client Quit]
kgrz has joined #ruby-lang
soahccc has quit [Ping timeout: 264 seconds]
security is now known as fire
Technodrome has quit [Quit: Technodrome]
jaimef has quit [Excess Flood]
Gaelan has quit [Remote host closed the connection]
Gaelan has joined #ruby-lang
Gaelan has quit [Remote host closed the connection]
Gaelan has joined #ruby-lang
jaimef has joined #ruby-lang
burgestrand has quit [Quit: Leaving.]
soahccc has joined #ruby-lang
havenwood has quit [Remote host closed the connection]
havenwood has joined #ruby-lang
glebm has joined #ruby-lang
<ledestin>
lewis1711: it's a hash
<ledestin>
just short version, w/o {}
<lewis1711>
ledestin: that was my first guess - but I can't declare a hash like that in irb
<ledestin>
lewis1711: puts :a => 1
<lewis1711>
"a = :a => 1" fails
<lewis1711>
as does just ":a => 1"
<lewis1711>
super confused to be honest
phoyce has joined #ruby-lang
<soahccc>
lewis1711: It's a feature of ruby that you can pass hash params to a method without the {} but in general you need them. you have to use method() if you want to pass {} because method {} would be a block
<havenwood>
lewis1711: It is an implicit hash, works as params and such: [a: 1]; #=> [{:a=>1}]
<havenwood>
lewis1711: Some call it a 'naked hash'.
Technodrome has joined #ruby-lang
<hagabaka>
lewis1711: So what you pasted is equivalent to page.forms_with({:action => '/post/login.php'}). Ruby allows it, and people do it, because it gives the illusion of supporting named parameters
ledestin has quit [Quit: ledestin]
runeb has joined #ruby-lang
runeb has quit [Read error: Connection reset by peer]
<lewis1711>
ahh. the silliest thing as I had come across this once before but promptly forgot about it
<lewis1711>
thanks all
Gaelan has quit [Remote host closed the connection]
vlad_sta_ has quit [Ping timeout: 264 seconds]
Gaelan has joined #ruby-lang
Gaelan has quit [Remote host closed the connection]
r0bby_ has joined #ruby-lang
burgestrand has joined #ruby-lang
Gaelan has joined #ruby-lang
runeb has joined #ruby-lang
kgrz has quit [Quit: Computer has gone to sleep.]
glebm has quit [Quit: Computer has gone to sleep.]
gix- has joined #ruby-lang
gix has quit [Disconnected by services]
r0bby has quit [Ping timeout: 252 seconds]
benanne has quit [Quit: kbai]
glebm has joined #ruby-lang
runeb has quit [Read error: Connection reset by peer]
mrfelix has quit [Ping timeout: 260 seconds]
mrfelix has joined #ruby-lang
Technodrome has quit [Quit: Technodrome]
burgestrand has quit [Ping timeout: 245 seconds]
burgestrand has joined #ruby-lang
stevechiagozie has joined #ruby-lang
mantono has joined #ruby-lang
robbyoconnor has joined #ruby-lang
swav has quit [Remote host closed the connection]
r0bby_ has quit [Ping timeout: 256 seconds]
runeb has joined #ruby-lang
nazty has joined #ruby-lang
kgrz has joined #ruby-lang
breakingthings has joined #ruby-lang
vbatts has joined #ruby-lang
soknee has joined #ruby-lang
kbouwser has joined #ruby-lang
bzalasky has joined #ruby-lang
runeb has quit [Remote host closed the connection]
Gaelan has quit [Remote host closed the connection]
Gaelan has joined #ruby-lang
Gaelan_ has joined #ruby-lang
Gaelan has quit [Ping timeout: 272 seconds]
runeb has joined #ruby-lang
vlad_starkov has joined #ruby-lang
robbyoconnor has quit [Ping timeout: 260 seconds]
mytrile has quit [Remote host closed the connection]
robbyoconnor has joined #ruby-lang
gix- has quit [Quit: Client exiting]
wallerdev has joined #ruby-lang
gix has joined #ruby-lang
Gaelan_ has quit [Remote host closed the connection]
bzalasky has quit [Remote host closed the connection]
soknee has quit [Quit: Leaving.]
maxmande_ has quit [Ping timeout: 245 seconds]
sonots has joined #ruby-lang
maxmanders has joined #ruby-lang
soknee has joined #ruby-lang
madb055 has joined #ruby-lang
stevechiagozie has quit [Quit: Computer has gone to sleep.]
sonots has quit [Remote host closed the connection]
pib1951 has quit [Remote host closed the connection]
runeb has quit [Read error: Connection reset by peer]
mbj has joined #ruby-lang
<mbj>
whitequark: hi
<whitequark>
mbj: hey
<whitequark>
yorickpeterse: you here?
<mbj>
whitequark: Just read your invitation.
<mbj>
Back in 5 min with coffe.
<whitequark>
mbj: yeah. let me describe a few design points meanwhile.
sonots has joined #ruby-lang
<whitequark>
for everyone else here: I'm writing a better ruby parser, and we're discussing the sexp format for it.
<whitequark>
mbj: first. I'd like to keep as compatible as RP/PT output as it is possible, semantics wise (i.e. node names, children order). however, pointless idiosyncrasies of RB/PT should be fixed.
<yorickpeterse>
whitequark: yes
<whitequark>
such as, for example, 0 instead of s(:args) for empty proc args.
<whitequark>
second. we need to add location information to everything, i.e. line and column spans. for this we need to decide what to do for composite nodes.
<whitequark>
for example, s(:defn) spans a lot of children nodes, a lot of columns and possibly lines.
<mbj>
whitequark: This will also allow more orignal source formatting + 1
<whitequark>
mbj: yup.
<mbj>
whitequark: Will you focus on generating sexp or an ast?
madb055 has quit [Read error: Connection reset by peer]
<mbj>
Both are interchangable, just curios.
<yorickpeterse>
The format will be S expressions
<yorickpeterse>
at least I take it will be
<whitequark>
mbj: this is an interesting question. as it seems that I'm the person most suited for hacking on the lexer/parse, and as we've already figured out with yorickpeterse, it is beneficial to have a "SAX-style" parser
<whitequark>
I will make the parse.y trigger callbacks which you can possibly override.
<whitequark>
this is first and foremost important for linters, etc, as both sexp and ast formats lose a lot of source-level detail.
Nikola1 has joined #ruby-lang
Gaelan has joined #ruby-lang
<mbj>
whitequark: It is okay for me to emit sexp. This also makes sure only a datastructure is emitted.
<mbj>
If you emit an ast you could couple stuff that does not belong there.
<whitequark>
mbj: s-exp format is important for compatibility with RP and is easier to work with. AST format is important for compatibility with rbx (do we need it?), and for my own projects, though I'm using sexps now too.
<whitequark>
I'm actually fine with having both in the gem.
<mbj>
whitequark: Maybe an AST is easier to mutate.
<yorickpeterse>
wouldn't using a SAX parser solve that issue?
<whitequark>
mbj: my furnace-sexp gem is designed so that exps are immutable
<whitequark>
yorickpeterse: sure, but we need people to write both backends and tests for them.
<whitequark>
mbj: it is supposed to be used that way, indeed.
<mbj>
whitequark: Perfect, this mirrors the style I use in mutant on the RBX ast.
<yorickpeterse>
whitequark: well yeah, and I'd be happy to help once I get back from my holidays
Gaelan has quit [Remote host closed the connection]
<mbj>
TBH I'm not very used to the RP ast. Give me some sec.
<whitequark>
so, let me explain my point. I'm willing to have both s-exp and AST backends, but only if I won't have to write, test and maintain both. I don't have enough time.
<whitequark>
note that you need to test that for 1.8, 1.9 and 2.0.
<whitequark>
yorickpeterse seems to prefer sexps too. so, let it be sexps.
<mbj>
We need a convention where to store the source, lineno in the sexp
<whitequark>
mbj: we already have this convention
<whitequark>
in Furnace sexps, you subclass them and add the attr_reader's you want
<mbj>
reading
<whitequark>
e.g. `attr_reader :line`. you then pass `line: 1` in the constructor and it sets the corresponding ivar.
Gaelan has joined #ruby-lang
Gaelan has quit [Remote host closed the connection]
<mbj>
Got it.
<whitequark>
mbj: so. now we only need a specification for the sexps themselves. which nodes can go where in which nodes, in a nutshell.
Gaelan has joined #ruby-lang
<whitequark>
and how the location info will be set.
<whitequark>
mbj: suggestions?
test__ has joined #ruby-lang
<mbj>
whitequark: I need to try for myself, no suggestions for now.
<whitequark>
mbj: "try for myself" as in?
<mbj>
whitequark: The ragel state should have the linneo and column
breakingthings has quit []
<whitequark>
mbj: I think I should make the lexer yyvalue a tuple of [text, location]
<whitequark>
right now it's just `text'
swav has joined #ruby-lang
brianpWins has joined #ruby-lang
<whitequark>
this way, I could just pass tokens to whatever's handling the parser's callbacks
<mbj>
whitequark: I do not know how the funace sexp gem works. I need to play around with it and imagine how to build an sexp tree from ragel callbacks.
<whitequark>
the location would be [line, start_col, end_col]; I do not think we have tokens which span multiple lines
<whitequark>
(heredoc strings are separated into multiple tokens)
sandbags has joined #ruby-lang
<whitequark>
mbj: I think I'll be able to provide examples after this weekend
<whitequark>
but please do explore the infrastructure :)
<mbj>
whitequark: For sure
<whitequark>
mbj: may I ask to what extent are you willing to work on the new parser?
<mbj>
whitequark: I never wrote a parser / lexer for a turing complete language
<whitequark>
i.e. "writing sexp spec", "writing sexp backend", "backend with tests". any of this would be a great help.
<mbj>
whitequark: Covering nodes and add rount trip tests via a to_source port.
<mbj>
*round
<mbj>
whitequark: We should start with literals and round trip them
<mbj>
whitequark: Than binary nodes, and than everything else.
<whitequark>
excellent! I believe that is a part of RubyParser tests, too.
<mbj>
So our tests are like. "assert_round_trippable, 'a = foo', [:assign, [:lvar, :a], [:call, :foo] ]"
Nikola1 has left #ruby-lang [#ruby-lang]
<mbj>
whitequark: Just give it a start, I pick stuff up very quickly.
swav has quit [Ping timeout: 272 seconds]
<whitequark>
let me explain the roadmap. at Monday or so I finish the ragel lexer and perform various restructurement of the repo to make it easier to work with.
<whitequark>
Then I'll have to rewrite the parser to emit SAX-style events.
<mbj>
whitequark: Why you forked? Lets start from scratch.
<mbj>
No need for the ruby-parser history, IMHO.
<mbj>
?
<whitequark>
mbj: Ok. We'll have to write all tests from scratch, then.
Gaelan has quit [Remote host closed the connection]
<whitequark>
Or no?
<mbj>
No real problem. I'd love to have mutant mutation cover them.
<whitequark>
There are also lexer tests.
<mbj>
mom, let me take a look on the ruby-parser test suite
<whitequark>
it's basically lexer tests and parser tests, some of which are in the RP repo and some are pulled from the sexp_processor gem
<mbj>
whitequark: As long as there is ruby code in a def node mutant will make sure we have covering tests.
<whitequark>
mbj: not sure if it is a good idea to run mutant over autogenerated bison/ragel output
<whitequark>
it's enormous, and most of the changes break *everything*
<mbj>
whitequark: I think more about the callbacks.
<mbj>
whitequark: If we do the callback handling in a dedicated class instance we can test them.
kgrz has quit [Ping timeout: 272 seconds]
<whitequark>
mbj: Callbacks are most often trivial...
kgrz has joined #ruby-lang
<mbj>
whitequark: You plan to do the callback handling within the ragel output?
<whitequark>
mbj: no, ragel lexer only communicates with bison parser
<whitequark>
they're dependent on each other.
<whitequark>
the callbacks are invoked by code in bison parser actions
<mbj>
whitequark: Never worked with bison so far. I'll have to learn this part.
Gaelan has joined #ruby-lang
<mbj>
whitequark: So the ragel callbacks are consumed by bison. In this case I agree it does not make sense to mutation cover them.
<whitequark>
there isn't really such a thing as "ragel callbacks", it's a sequence of tokens
<mbj>
whitequark: Yeah, I used to directly create AST like structures from ragel.
<autarch>
not sure if my last message got through - I'm getting an error trying to install the debugger-linecache gem - https://gist.github.com/autarch/5277766
<mbj>
drbrain: I think we'll go for a poro solution.
<mbj>
drbrain: s/poro/puru/ ;)
<autarch>
It looks like it can't find some headers it's looking for - is this a ruby version issue?
amerine has quit [Quit: Computer has gone to sleep.]
<mbj>
drbrain: But this could speed us up a lot, thx again!
<mbj>
Is this channel logged somewhere? So I can point dkubb to this discussion?
cored has joined #ruby-lang
cored has quit [Changing host]
cored has joined #ruby-lang
<drbrain>
mbj: whitequark keeps an online log
<drbrain>
I forget the URL
<drbrain>
autarch: it sounds like the gem hasn't been updated for your version of ruby
<mbj>
drbrain: found it, thx
bzalasky has joined #ruby-lang
<autarch>
weird, if I do "gem install debugger" manually it seems to work
<autarch>
it just wasn't happy doing it via "bundle install"
havenwood has joined #ruby-lang
symm- has joined #ruby-lang
bzalasky has quit [Remote host closed the connection]
havenwood has quit [Ping timeout: 246 seconds]
Gaelan has quit [Remote host closed the connection]
bzalasky has joined #ruby-lang
ledestin has joined #ruby-lang
<yorickpeterse>
whitequark: mbj: sorry for the AFK'ness, I was on the phone
<yorickpeterse>
just finished reading the log
autarch has left #ruby-lang [#ruby-lang]
vlad_starkov has quit [Ping timeout: 272 seconds]
stevechiagozie has joined #ruby-lang
Gaelan has joined #ruby-lang
fire has quit [Ping timeout: 255 seconds]
io_syl has quit [Ping timeout: 245 seconds]
<mbj>
yorickpeterse: no problem
<mbj>
yorickpeterse: what do you like/dislike on the current state of the discussion?
<yorickpeterse>
neutral, I need to get my hands dirty with some code before I can form a solid opinion. Having said that, I do like the direction of SAX/sexp for the parser.
io_syl has joined #ruby-lang
havenwood has joined #ruby-lang
<yorickpeterse>
Though I'm not sure if I understand the use of parse.y since it emits C code, and not Ruby
<yorickpeterse>
which would prevent it from working on jruby
<mbj>
yorickpeterse: I think bison can also emit ruby
<mbj>
yorickpeterse: I'd love jruby compat, the main reason I'm participating here is to port mutant to jruby
<yorickpeterse>
from what I've been told Bison only does C/C++, you'd need to use racc for Ruby
<mbj>
yorickpeterse: Also I plan to do more ruby ast processing and the RBX ast is good but aligned to the bytecode emitter needs to closely
<yorickpeterse>
and since parse.y contains C code directly I'm not sure if that would work out
<mbj>
I'm currently googling for bsion and ruby
kennyvb has quit [Ping timeout: 256 seconds]
stevechiagozie has quit [Quit: Computer has gone to sleep.]
<mbj>
yorickpeterse: The parse.y whitequark created does not have C anymore
<zzak>
drbrain: whats the syntax to try this in rdoc?
<zzak>
file: or ?
<drbrain>
I think file: that ends in .png, .jpg
<drbrain>
I'd have to poke around to find out
<zzak>
np
<zzak>
{whatever}[file:foo.png] just creates a link
vlad_starkov has joined #ruby-lang
vlad_starkov has quit [Read error: Connection reset by peer]
<zzak>
i couldnt find any docs on using images in rdoc either
<zzak>
just old stuff that says use [img:foo]
vlad_starkov has joined #ruby-lang
havenn has joined #ruby-lang
<drbrain>
I think there are tests for the img: stuff
fire has quit [Ping timeout: 240 seconds]
baba has joined #ruby-lang
<mbj>
whitequark: I'm out for now, wish you a happy weekend.
<mbj>
drbrain, yorickpeterse: Same for you.
mbj has quit [Quit: leaving]
<whitequark>
zzak: what about ![](/foo.png) ?
<zzak>
whitequark: http:///foo.png
<whitequark>
zzak: what parser do you use?
<zzak>
rdoc markdown
<zzak>
i would use plain rdoc, but not sure how to create an image using it
<whitequark>
oh, why does rdoc use its own markdown parser? :(
<zzak>
and cant find any docs or tests that tell you how, except for {<img src=}[foo]
<zzak>
because its awesome
<whitequark>
people share code exactly to avoid problems like this, no?
<zzak>
what does that mean
kristofferrr has quit [Ping timeout: 252 seconds]
<whitequark>
well I meant that if rdoc used, for example, kramdown, there will be no need to reimplement the parser and you'll have awesome features of kramdown for free. no?
<drbrain>
whitequark: does kramdown provide a syntax tree?
<drbrain>
whitequark: an HTML-only markdown parser doesn't work for `ri`
<whitequark>
I'm fairly sure I'm going to use either this, or rdoc-tomdoc...
<whitequark>
thanks for telling me about tomdoc btw, I really like it.
<mbj>
whitequark: Back, do not have to run.
<drbrain>
if kramdown was MIT licensed last year I would have worked to import or integrate it into RDoc
madb055 has joined #ruby-lang
<whitequark>
mbj: what do you think about using tomdoc for parser?
amerine has joined #ruby-lang
<mbj>
whitequark: Does it have something like yardstick? A tool that ensures coverage?
havenn has quit [Remote host closed the connection]
<whitequark>
mbj: there's a plugin for both yard and rdoc.
<whitequark>
ie it is not a documentation tool on its own, it's just a description format which is way more readable than yard tags.
kith_ is now known as kith
mbj has quit [Ping timeout: 256 seconds]
mbj has joined #ruby-lang
<mbj>
whitequark: As I said, your repo your rules. I'm trained very much to use yardstick.
<mbj>
whitequark: So I can parse the yardstick commends very fast when browsing code
<mbj>
whitequark: the @notation has a good visual signature for the eyes
<r0bglees0n>
whitequark: it can't describe as much as YARD metatags, though.
<mbj>
whitequark: I'd miss yardstick a lot.
<mbj>
whitequark: We use yardstick in devtools in a way rake ci fails if you missed a required tag
<mbj>
for the others listening, devtools is a metagem we use in dm2 development.
<yorickpeterse>
I think tools like these are way overkill for now
<whitequark>
I agree with yorickpeterse
<yorickpeterse>
I'd much rather focus on writing the parser and tests than documentation/code coverage
<yorickpeterse>
Things will change too often anyway
<whitequark>
this is actually the first time I ever hear about documentation coverage measurement, to be honest
bzalasky has quit [Remote host closed the connection]
<r0bglees0n>
yard has had that for a while. rdoc came soon after.
<whitequark>
I'm not opposed to yard so I think we may give it & yardstick a try
<whitequark>
r0bglees0n: in the yardstick sense, I've meant
<r0bglees0n>
ah okay.
<whitequark>
yard measures just the covered classes/methods; yardstick is really much more thorough, it checks docs for parameters, return values, etc
<whitequark>
I can see value in that but it's a lot of work and sometimes I believe this can lead to great redundancy
<whitequark>
the parameter "is_boolean" is kinda self explanatory, there is really no need to attach an yard tag to it.
<yorickpeterse>
stuff like that should be put in once the code is coming together, not from the start
<yorickpeterse>
it only slows development down
<r0bglees0n>
whitequark: well, yard actually tries to be smart and makes a smart guess in some cases.
<r0bglees0n>
for example, in the case of #initialize
<whitequark>
r0bglees0n: yeah I've seen that
<zzak>
drbrain: im only able to show the image using rdoc when i do: {<img src=foo />}[bar]
<mbj>
whitequark: You can rise the documentation coverage bar
<mbj>
whitequark: you do not have to start with 100%
<mbj>
whitequark: But it is good to notice if your coverage drops below your current thresold
<drbrain>
zzak: image support in RDoc has always been limited :/
chessguy has quit [Remote host closed the connection]
<whitequark>
mbj: let's start with free-form documentation and see how that goes
<mbj>
yorickpeterse: I'd opt to use yardstick with a thresold of 0% once it increases the task will notice and we can adjust
<yorickpeterse>
I'd opt not to use it until it's actually useful. There's no point in adding X, keeping it at zero usage when things are still moving around
<mbj>
whitequark: Als long as you do not reject my yard style commits I can accept this ;)
<yorickpeterse>
might as well add it when needed
<whitequark>
mbj: let's see how it goes.
<mbj>
yorickpeterse: I used those tools successfuly in greenfield projects. Both commercial and opensource.
<yorickpeterse>
now to finish my Euruko proposal
mytrile has joined #ruby-lang
<whitequark>
mbj: yard is fine but I'd really want to avoid documenting obvious things.
<whitequark>
that just litters the code with useless comments
<mbj>
whitequark: So you only document public api?
<whitequark>
mbj: no no, why only public api? I was talking about attaching a comment like "Creates a boolean node." for the `def create_boolean_node`, etc.
<mbj>
For me writing documentation is a very good step to think about the code.
<mbj>
Once I have to document stuff like create_boolean I ask my self: Can I describe this in a few words. If I'm not capable it might need a redesign.
<zzak>
drbrain: np, just have a very special usecase for this and wanted to use rdoc
<mbj>
whitequark: We'll see how it goes ;)
<whitequark>
mbj: I see. I'm not going to reject commits because they have too much docs :D
<r0bglees0n>
yorickpeterse: where is the next heroku?
<whitequark>
zzak: oh neat, it already includes jruby support
kirin` has joined #ruby-lang
blacktulip has quit [Remote host closed the connection]
srbaker has quit [Quit: Computer has gone to sleep.]
kirin` has quit [Ping timeout: 260 seconds]
<yorickpeterse>
whitequark: how so? The general concept is fairly simple
mbj has joined #ruby-lang
<yorickpeterse>
unless parse.y works from outer to inner, instead of the other way around
ryanf has quit [Quit: leaving]
<whitequark>
yorickpeterse: of course it works from inner to outer
<mbj>
whitequark: You created lexer.rl from reverseing the handwritten C in MRI parse.y? Or is there some kind of documentation for all these details such as nested heredocs?
kirin` has joined #ruby-lang
ryanf has joined #ruby-lang
<whitequark>
mbj: mostly by treating Ruby MRI as a black box and trying to find a minimal sensible algorithm producing the same result
<whitequark>
I did reverse-engineer EXPR_* stuff
<whitequark>
the heredoc part was blackboxed.
<yorickpeterse>
whitequark: in that case it shouldn't be that har
<yorickpeterse>
* hard
<whitequark>
yorickpeterse: there are tons of slightly different but essentially the same cases in parse.y
<whitequark>
like four variants of `alias`
<zzak>
whitequark: its stdlib
<zzak>
so jruby has a racc
<whitequark>
zzak: I want to run the racc executable to generate a grammar
chessguy has joined #ruby-lang
<yorickpeterse>
whitequark: are we talking about "a lot of work" in terms of quantity or complexity?
<whitequark>
because CI
<whitequark>
yorickpeterse: complexity, mostly. to avoid turning it into quantity :)