isale-eko has quit [Quit: ChatZilla 0.9.88.2 [Firefox 12.0/20120420145725]]
gsav has joined #ruby-lang
banisterfiend has joined #ruby-lang
savage-_ has quit [Remote host closed the connection]
havenn has quit [Remote host closed the connection]
savage- has joined #ruby-lang
RegEchse has quit [Quit: <3 WeeChat (v0.3.9-dev)]
benanne has quit [Quit: kbai]
droptable has quit [Ping timeout: 264 seconds]
nofxx has quit [Ping timeout: 272 seconds]
burgestrand has quit [Quit: Leaving.]
sailias has joined #ruby-lang
ryez has joined #ruby-lang
s0ra_h is now known as sora_h
coryf has quit [Remote host closed the connection]
adam__ has joined #ruby-lang
droptable has joined #ruby-lang
nofxx has joined #ruby-lang
savage- has quit [Remote host closed the connection]
<jarib>
what's the benefit of defining a scope with a lambda over a plain class method?
jperry2 has quit [Ping timeout: 240 seconds]
adam__ has left #ruby-lang [#ruby-lang]
<jarib>
oops, wrong channel
gsav has quit [Ping timeout: 272 seconds]
adamSpeaks has joined #ruby-lang
sora_h is now known as s0ra_h
adamSpeaks has left #ruby-lang [#ruby-lang]
gsav has joined #ruby-lang
jperry2 has joined #ruby-lang
diegoviola has quit [Ping timeout: 245 seconds]
adamIsAdam has joined #ruby-lang
abletony84 has quit [Quit: Lost terminal]
w0lverine has quit [Quit: w0lverine]
<adamIsAdam>
How does one, in rmagick have text line wrap at a certain length, while still formatting certain words? RMagick doesn't support, natively, formatting for individual words and RVG doesn't support line wrapping. Any help here?
IPGlider has joined #ruby-lang
krz has quit [Quit: krz]
pbjorklu1d has quit [Read error: Operation timed out]
pbjorklund has joined #ruby-lang
ryez has quit [Ping timeout: 245 seconds]
gsav has quit [Ping timeout: 246 seconds]
sailias has quit [Quit: Leaving.]
akira989 has quit [Remote host closed the connection]
havenn has joined #ruby-lang
IPGlider has quit []
justinseiter has quit [Quit: Leaving]
s0ra_h is now known as sora_h
burgestrand has joined #ruby-lang
jackhammer2022 has joined #ruby-lang
dous has quit [Remote host closed the connection]
jtoy has joined #ruby-lang
chimkan has quit [Quit: chimkan]
diegoviola has joined #ruby-lang
nagato has joined #ruby-lang
ChadStud1uffin has quit [Ping timeout: 240 seconds]
sora_h is now known as s0ra_h
towski has quit [Remote host closed the connection]
deryl has quit [Ping timeout: 240 seconds]
imajes has quit [Excess Flood]
imajes has joined #ruby-lang
dous has joined #ruby-lang
DEac- has quit [Read error: No route to host]
<erikh>
anyone look at rust yet? I'm really digging what I'm reading... wondering if anyone has any practical experience yet
DEac- has joined #ruby-lang
<banisterfiend>
hey Erik
<banisterfiend>
what's cool about it
<erikh>
rust-lang.org will tell you more than I will
<erikh>
it's a bit like D, but with more emphasis on immutable types and inference, and a lot more cohesion
<erikh>
it's a mozilla project too
<banisterfiend>
erikh: are oyu interested in learning scala
<erikh>
I poked at it, got kind of bored, and wandered off
<erikh>
hrm, rust 0.3.1 doesn't build under clang
<erikh>
at least, not with whatever homebrew does to it
qpingu has quit [Quit: Leaving.]
<erikh>
it's apparently still alpha so that's not surprising
arooni-mobile has quit [Ping timeout: 272 seconds]
apeiros has quit [Remote host closed the connection]
naz has quit [Ping timeout: 252 seconds]
naz has joined #ruby-lang
erichmenge has quit [Quit: Be back later]
erichmenge has joined #ruby-lang
erichmenge has quit [Client Quit]
s0ra_h is now known as sora_h
dous has quit [Remote host closed the connection]
igotnolegs has joined #ruby-lang
dous has joined #ruby-lang
chimkan_ has joined #ruby-lang
w0lverine has joined #ruby-lang
jtoy has quit [Quit: jtoy]
b1rkh0ff has quit [Ping timeout: 248 seconds]
havenn has quit [Remote host closed the connection]
charliesome has joined #ruby-lang
sora_h is now known as s0ra_h
burgestrand has quit [Quit: Leaving.]
countdigi has quit [Remote host closed the connection]
countdigi has joined #ruby-lang
havenn has joined #ruby-lang
seanstickle has quit [Quit: seanstickle]
dous has quit [Remote host closed the connection]
erichmenge has joined #ruby-lang
havenn has quit [Remote host closed the connection]
countdigi has quit [Quit: leaving]
countdigi has joined #ruby-lang
banisterfiend has quit [Ping timeout: 246 seconds]
banisterfiend` has joined #ruby-lang
erichmenge has quit [Quit: Be back later]
w0lverine has quit [Quit: w0lverine]
ylluminate has joined #ruby-lang
w0lverine has joined #ruby-lang
eban has quit [Quit: WeeChat 0.3.7]
eban has joined #ruby-lang
s0ra_h is now known as sora_h
tedwing has joined #ruby-lang
vertroa_ has joined #ruby-lang
dous has joined #ruby-lang
<tedwing>
I need help parsing dates. My input is either in the format 'yyyy.mm.dd' or 'yyyy.mm'. Is there a way of creating a new Date that handles both formats, in the latter case using a default value for the day?
zenspider has quit [Read error: Connection reset by peer]
dc5ala has quit [Quit: Ex-Chat]
skipper has quit [Remote host closed the connection]
dous has quit [Remote host closed the connection]
benanne has quit [Quit: kbai]
awwaiid has quit [Read error: Connection reset by peer]
andreivolt has joined #ruby-lang
r0bby has joined #ruby-lang
awwaiid has joined #ruby-lang
diegoviola has quit [Ping timeout: 244 seconds]
kiddorails has left #ruby-lang [#ruby-lang]
robbyoconnor has quit [Ping timeout: 245 seconds]
dous has joined #ruby-lang
dous has quit [Changing host]
dous has joined #ruby-lang
vertroa_ has quit [Read error: No route to host]
havenn has joined #ruby-lang
dhruvasagar has joined #ruby-lang
jtoy has joined #ruby-lang
tjadc has joined #ruby-lang
burgestrand has joined #ruby-lang
ryez has quit [Ping timeout: 245 seconds]
dhruvasagar has quit [Ping timeout: 246 seconds]
cantonic has quit [Quit: cantonic]
vertroa_ has joined #ruby-lang
havenn has quit [Read error: Connection reset by peer]
havenn has joined #ruby-lang
pbjorklund has quit [Ping timeout: 246 seconds]
savage- has joined #ruby-lang
sandbags has quit [Remote host closed the connection]
apeiros_ has quit [Remote host closed the connection]
fourlastor has joined #ruby-lang
<fourlastor>
hello everyone! :)
apeiros_ has joined #ruby-lang
pbjorklund has joined #ruby-lang
<fourlastor>
do you think is rubygame good to achieve something like that: http://wiki.fifengine.net/Main_Page ? in case it isn't, is there anything around that could work as a isometric game engine?
<fourlastor>
i searched in rubygems but i didn't find anything else
<Harzilein>
Spaceghostc2c: first url is _not_ helpful, again, this is _not_ one of this situations where i want to do something specific, it is asking if something can be done in a specific way.
zmack has joined #ruby-lang
<Spaceghostc2c>
Harzilein: When you're saying using it as a heredoc, you just want to capture the contents of the proc and put it into a string?
<Harzilein>
Spaceghostc2c: yes
verbad has joined #ruby-lang
towski has joined #ruby-lang
<Harzilein>
Spaceghostc2c: but it should not be required to be valid ruby syntax
<Harzilein>
Spaceghostc2c: like my example of dangling braces
s0ra_h is now known as sora_h
<manveru>
i'm not sure i know any language that allows such things... maybe perl6 or lisp?
<Spaceghostc2c>
hakunin: So, essentially, you're wanting a proc to know how to turn itself into a string without evaluating the contents of the block, right?
<Harzilein>
manveru: i was actually wondering about lisp, i just don't know if you can do here-docs with common lisp's macros
<manveru>
i think it still requires balancing of braces
<Harzilein>
manveru: i was thinking about having yet another "humane" markup language, but have some way to add "parser annotations" to some unstructured data
<Harzilein>
manveru: meh
<Spaceghostc2c>
Harzilein: And with ruby, block style DSLs are often used to defer evaluation of the contents of the block until some point, right?
<hakunin>
Spaceghostc2c: sounds like a great thing to want, why not?
<Spaceghostc2c>
hakunin: I'm asking you questions you should be asking a duck. :)
<manveru>
Spaceghostc2c: evaluation is later, but parsing is immediate
<Harzilein>
actually that markup does not really need to be interpreted by ruby, i was just thinking that extending erb to do what i want would make for a nice prototype
verbad has quit [Client Quit]
* hakunin
has no idea what's going on here
dfr|mac has quit [Remote host closed the connection]
jtoy has quit [Quit: jtoy]
sailias has quit [Quit: Leaving.]
sailias has joined #ruby-lang
fgomez has joined #ruby-lang
adam___ has joined #ruby-lang
sailias has quit [Client Quit]
<Harzilein>
i guess i'll get the question out of the way if common lisp could do heredocs that do not necessarily have lisp "syntax" (balanced braces)
* Harzilein
heads over to a common lisp channel
<manveru>
:)
<Spaceghostc2c>
manveru: You're wrong.
<Spaceghostc2c>
manveru: Parsing isn't immediate.
<manveru>
?
<Spaceghostc2c>
Harzilein: You can do this with procs if you redefine to_s or do something similar.
<Spaceghostc2c>
manveru: Try it.
<manveru>
prove me wrong
<rue>
Spaceghostc2c: Too.
<Harzilein>
Spaceghostc2c: hmm...
<manveru>
i'd love to see that :)
<rue>
Perhaps a misconception about the term
gsav has joined #ruby-lang
<Spaceghostc2c>
manveru: Go try it. Play around with the proc class.
<manveru>
Spaceghostc2c: i'm doing ruby since 2005, had plenty of playtime with procs
<Spaceghostc2c>
manveru: Mmmkay.
<rue>
2001, and yeah.
<Harzilein>
Spaceghostc2c: i'm missing the idea how i could have ruby not attempt to parse the content of the blocks
<Spaceghostc2c>
Anyways, he's wrong. They only get checked when the proc gets called.
<rue>
…Checked?
<rue>
Harzilein: You have some code that may or may not be valid?
leachim6 has left #ruby-lang ["Leaving"]
<Harzilein>
the proc will never get called if i have a dangling bracket inside the block
<manveru>
Spaceghostc2c: show me
<Harzilein>
#lisp tells me i want to use "reader macros"
<Spaceghostc2c>
manveru: proc = Proc.new {lolwat}
<manveru>
that's correct syntax
<Harzilein>
i guess those are similar to BEGIN {} in perl ;)
<Spaceghostc2c>
Harzilein: If you like lisp, do it there! It's shiny and fun in lispland.
<rue>
Spaceghostc2c: Just to be clear, parsing means taking the characters that make up the code and constructing an internal representation out of that
<rue>
Harzilein: I don’t understand the problem. You *want* to allow using invalid/non-ruby syntax?
<manveru>
Spaceghostc2c: ruby -e 'lambda{ for a := 1; a < 10; a++ { println(a) } }'
<manveru>
try getting that to parse
<manveru>
it even has balanced braces
gsav has quit [Ping timeout: 244 seconds]
<Harzilein>
rue: yes
<rue>
Harzilein: You should probably define a simple grammar for yourself
mwjcomputing has joined #ruby-lang
<manveru>
Harzilein: the closest i know is polyglot gem
<manveru>
but not in the same file
<manveru>
unless you write a parser for ruby that embeds your language... which is like 5 billion times harder
<Spaceghostc2c>
manveru: Let me look for something.
sora_h is now known as s0ra_h
adam___ has quit [Quit: adam___]
zmack has quit [Remote host closed the connection]
workmad3 has joined #ruby-lang
vertroa_ has joined #ruby-lang
chimkan has joined #ruby-lang
deryl has joined #ruby-lang
<Spaceghostc2c>
Harzilein: Two options I have thought up sort of might work. You could use #source_location to find the line in the file and print it back out as a string, or you could wrap the Proc class with a custom class that has #to_s and #call methods, and then have your DSL use that class.
<Spaceghostc2c>
manveru: Trying to see if I can introspect a proc for it's body, not sure if I can with 1.9
<manveru>
Spaceghostc2c: neither works
<Spaceghostc2c>
manveru: Why?
<manveru>
you can get the ast in rbx
<Mon_Ouie>
You can get ruby bytecode in 1.9, but that's it
<manveru>
but only if it's valid ruby syntax
<manveru>
source_location also only works on parsed procs
<manveru>
and custom to_s and call... i have no idea where you learned that BS
gsav has joined #ruby-lang
<Spaceghostc2c>
manveru: It could work, but it's ucky in that you'd be storing the source of the intended proc in a instance variable.
<Spaceghostc2c>
It wouldn't be awesome, no.
<manveru>
you can use a heredoc for that already
<Spaceghostc2c>
manveru: In a blockstyle DSL
<Spaceghostc2c>
?
<manveru>
no
<Spaceghostc2c>
Then how does that help?
<manveru>
it would at least work
<manveru>
have you ever written a language parser?
brianpWins has quit [Quit: brianpWins]
apeiros_ has quit [Remote host closed the connection]
<manveru>
try it sometime for a language like forth, plenty of fun to be had :)
mwjcomputing has quit [Ping timeout: 246 seconds]
<manveru>
anw, the reason why what you describe is impossible, is that ruby has to check that all the syntax in a file is valid
mwjcomputing has joined #ruby-lang
gsav has quit [Ping timeout: 246 seconds]
<manveru>
if ruby sees 'do', it makes a little note like "we're expecing an 'end' before the end of file"
<Spaceghostc2c>
manveru: Yeah, I would expect that to be present in his DSL.
<manveru>
but then goes on and tokenizes everything after the "do"
<Spaceghostc2c>
So having MyProc take the input and save it into a string and then call Proc.new and continue with a #to_s to just print the string wouldn't work in some respect?
<manveru>
yeah, the "having MyProc" wouldn't work
<Spaceghostc2c>
manveru: What pry does seems suitable for his cause.
<Spaceghostc2c>
manveru: Why wouldn't it?
<Harzilein>
the #lisp guys make a good point, translating their argument the only real benefit about such a dsl that they can require their dependencies instead of having them opened and parsed. i have seen there was some discussion that there is no standard way to have erb files include each other, i.e. they need to know how the implementation opens files.
dhruvasagar has quit [Ping timeout: 264 seconds]
<Harzilein>
s/a dsl/dsls is/
fgomez has quit [Quit: leaving]
fgomez has joined #ruby-lang
<manveru>
well, some templating engines have virtual filesystems that fix that somewhat
enebo has quit [Quit: enebo]
<Harzilein>
hmm...
<manveru>
but really, even in lisp you need to enclose your macro correctly
chimkan has quit [Quit: chimkan]
<Harzilein>
what could help me with this particular unstructured data would be 2-level %q{}-like escape where writing %q{1 2 3\n2 3 4 5\n1} would result in [[1,2,3],[2,3,4,5],[1]]
<manveru>
either that, or i didn't read SICP right
<Harzilein>
+s
<manveru>
hm
<Harzilein>
sicp was scheme and that doesn't have reader macros at all, doesn't it?
<Harzilein>
i think reader macros must have the same amount of power as compilation time perl (in BEGIN{})
<manveru>
pretty sure racket at least has something equivalent
<manveru>
well, been a while :)
<Harzilein>
well, i'm pretty sure r5rs does not have any fancy reader macros facility