# IRC log for #testml, 2012-12-29

All times shown according to UTC.

Time Nick Message
00:26 rking joined #testml
00:32 ingy rking: cool, I hope to get it coded tonight
00:32 ingy I mean it already works this way in testml.pm
02:10 rking ingy: Really nice doc.
02:11 rking Just cautionary enough: "easy to read, but a little bit different than traditional OO"
02:11 rking The multisplat syntax is still a puzzle to me.
02:43 ingy rking: what do you mean by multisplat?
02:44 ingy splat == '*' right?
02:45 ingy *a.b(*c).d == *e
02:45 ingy like that?
02:46 ingy there's lots of depths I can explain at
02:46 ingy but the simplest is
02:47 ingy if a statement has a method that begins with *, scan the Blocks array for each block that contains all the splat names
02:48 ingy then execute the statement once for each block, replacing the splat name with its Block value
02:49 ingy a set of blocks can serve many different tests
02:49 ingy not all blocks apply to all tests statements
02:49 ingy does it make sense now?
02:55 rking I just don't see how it's ambiguous
02:55 rking *(a.b(c).d == e)
02:55 rking "Iterate all the things."
02:56 rking Σ(a.b(c) == e)
02:56 rking ∀(a.b(c) == e)
03:06 rking If ASCII I prefer "@", because it looks like a washing machine and also has Perlish Array connotations.
03:06 rking But the point is that you're either iterating everything or nothing, so you shouldn't have to repeat the "everything" directive, whatever it is.
03:23 ingy say there are 10000 blocks
03:23 ingy but only 5 have a, c & e
03:23 ingy I only want those 5
03:25 ingy *x is just shorthand for Point('x')
03:25 ingy get the value of point 'x' from the current block
03:27 ingy another way to do what I did above is: mytest = {a.b(c).e == e}; mytest(*a, *c, *e)
03:27 ingy that actually works now
03:28 ingy your version doesn't work because you don't know what is data points and what is function names
03:30 ingy in terms of sigils, think of *foo as a pointer to the foo data
03:31 ingy much like yaml
03:31 ingy I suspect it was lifter from yaml
03:31 ingy *lifted
03:33 ingy http://cpanratings.perl.org/dist/Test-Base
03:33 ingy :)
03:33 ingy we win
03:38 rking Coolness.
03:38 rking And I think I get the Point()-notation thing now.
03:41 ingy Being able to have a lot of blocks in one data set, helps dry things out
03:41 ingy and then you just select the ones you need for a test
03:43 ingy ha, I just found 3 rhyming methods I made up a long timeago
03:43 ingy getvar
03:44 ingy setvar
03:44 ingy forgetvar
03:44 ingy :)
03:44 ingy jetvar rhymes with the same char count
03:46 ingy is there a fast way to make a getter that returns a constant?
03:47 ingy or just
03:47 ingy def foo; 'bar' end
03:48 ingy btw, attr_accessor is a terrible name
03:59 ingy undefined method 'foo' for nil:NilClass
03:59 ingy such a stupid msg
04:00 ingy perl++ for going a little farther and giving help for common mistakes
04:02 rking Rails actually has a bit of further support for NilClass#method_missing
04:02 rking Gives you clues
04:02 rking But yeah, def foo; 'bar' end is what I do
04:06 ingy :\
04:06 rking Wai U :\ ?
04:06 rking Tryin to be like some MS-DOS prompt or smth?
04:06 rking ö:\>
04:06 rking Nah what's up?
04:07 rking If I cared about it looking good on the caller side, I'd do that. If it was just a plain old constant, I'd be like:
04:07 rking FOO = 'bar'
04:27 ingy you gotta admit that ruby has a fair bit of ugly in it
04:28 ingy UinScript will just have to rock it
04:28 ingy Uni
04:28 ingy you know why it's called UniScript?
04:43 rking No, actually.
04:46 ingy rking: need ruby help
04:46 rking K I'm around for a few
04:47 ingy UniScript is a lang of mostly unicode methods ☺
04:47 ingy I figure since it will be so 1337, why not
04:47 ingy so I am inside an instance method
04:48 ingy how do I call self.foo=
04:48 ingy ?
04:48 ingy Oh I think I know what's happening
04:48 ingy :\
04:50 ingy I expected it to gripe that foo= was not defined
04:50 ingy but a had an attr_accessor :foo
04:50 ingy anyway all good
04:51 ingy rking: ^^
04:51 rking +1 rking cardboard programmer extraordinaire.
04:51 ingy rking: are you having great conversations in other chans?
04:51 ingy seems like its hard to get hold of you
04:52 ingy or maybe your new client is the suck
04:52 ingy like this... :(
04:52 rking Actually, on this laptop I get no beeps
04:52 ingy aha
04:52 rking So if I'm doing anything I have to busy-poll IRC to see messages
04:53 ingy I need to get a hold of the ruby yaml people
04:53 ingy who should I bug?
04:54 ingy rking: beep beep
04:54 rking Urr, I'm not sure about that.
04:54 ingy they need to get rid of that bang
04:55 rking Which'n?
04:55 ingy terrible
04:55 ingy foo: ! '*bar'
04:55 rking Is it not on Github?
04:55 ingy should just be
04:55 ingy foo: ! 'bar'
04:56 rking syck, psych, or both?
04:56 ingy I think psych is core ruby
04:56 rking https://github.com/tenderlove/psych
04:56 rking Seems like it's a Tenderlove thing. He's pretty busy.
04:56 rking I tried to contact him before about a different thing and it was a slow process.
04:57 rking But maybe you can throw that döt-power around a bit.
04:57 ingy huh
04:57 ingy maybe
04:57 ingy I can patch it for him
04:57 rking Yeah
04:57 rking I'm sure that'd be welcomed.
04:57 rking Or, discussed at least.
04:57 ingy I think he is just using the libyaml default
04:58 rking I don't get why "! '*bar'" vs "! 'bar'"
04:58 rking What are you dumping?
04:58 ingy foo: '...' # is a string
04:59 ingy foo: ... # probably a string but open to implicit typing
04:59 ingy foo: ! '...' # same as foo: ...
05:00 ingy some strings like *bar need quotes
05:00 ingy so the ! says treat them like they are unquoted
05:01 ingy but string is the default type anyway
05:01 rking So ! '*bar' is the same as *bar, a reference to an anchor?
05:01 ingy no
05:01 rking "treat them like they are unquoted"
05:02 ingy values with quotes are strings always
05:02 ingy foo: 123
05:02 rking Ok, got that
05:02 ingy is 123 a string or number?
05:02 rking Implementation-defined?
05:02 ingy correct
05:02 ingy implictly typed
05:03 ingy could be anything actually
05:03 ingy could be a date or a piece of chewing gum
05:03 rking Hehe
05:04 ingy so let's say 123 is cherry gum and *xyz is fruit-stripe
05:04 ingy but we can't print *xyz without quotes
05:05 ingy but we want to implicitly type it to fruit-stripe gum on load
05:05 ingy so we do ! '*xyz'
05:05 ingy that's a valid use of !
05:05 ingy although it's really rare
05:05 ingy because you would say !gum
05:06 ingy unless you were a very very niche candy yaml app
05:06 ingy so ! 'string' is almost never needed
05:06 rking Oh, ok
05:07 rking What's the piece that makes those decisions within the load process?
05:08 ingy so he is telling the libyaml emitter, emit the chars *xyz and I don't know what type it is because I'm too lazy
05:08 rking "Construct"? http://www.yaml.org/spec/1.2/overview2.png
05:08 ingy and libyaml says, fine, I'll make it open to implicit typing
05:09 rking Ahh
05:09 ingy it's called type resolution and happens during construction
05:09 rking So he just needs to tell libyaml that it is a string?
05:09 ingy yes!
05:09 rking hehe
05:10 rking So, if you do this, you'll get 1000s of diffs upon psych upgrades
05:10 rking Is that an issue, or screw any tool that tries to use yaml outside of a proper loader?
05:10 ingy he can add a compat option
05:10 rking Ahh, yeah.
05:11 rking Options.
05:12 ingy on the flip side, it's an easy way to guess if a yaml was human or machine written
05:16 rking Assuming people haven't been cargo culting that (and I'm sure they have)
05:23 ingy it's basically libyaml doing the right thing for the lack of info it was given
05:24 ingy hmm
05:24 ingy I could fork it to psychic
05:24 rking -ic == ingy's choice?
05:24 ingy Psych Ingy Corrected
05:25 rking Aha
05:25 ingy or whatever
05:25 ingy if tenderboy won't play ball
05:31 ingy rking: does ruby have implicit initialize chaining?
05:31 ingy or do you need to call super?
05:57 rking super
06:00 rking (Because sometimes you want that to happen first, sometimes last, and I guess sometimes never)
06:09 ingy yeah, it's a punt
06:09 ingy but in this case its probably best to punt
06:10 ingy Moose does any ordered traversal that you can't mess with
06:10 ingy and then hooks for before/after stuff
06:10 ingy either way has its goods and bads
06:10 rking Ah
06:11 ingy I'm doing an ingy-deep-dive-red-var
06:11 ingy red-bar
06:11 ingy just rewriting everything to my new mental model
06:11 ingy you'd hate it
06:12 ingy but I'm so frustrated from days of no progress
06:12 ingy I finally got a decently clear mental model
06:12 ingy it's somewhat test driven though
06:12 ingy I have my old tests
06:13 ingy so constantly running the whole thing
06:13 ingy even thought the test code is changing as much as anything
06:15 rking Well, that's sort of a reimagining of the user-facing features
06:15 rking Which isn't necessarily restricted by incrementalism.
06:15 rking It's just that I'd get to that outer green bar a tiny green segment at a time.
06:18 ingy I feel like there's too many forces at play
06:18 ingy I have to load it all into ram
06:19 rking I'd have to write a few languages before I could speak on how to TDD the implementation, but I imagine it's just a matter of building up from little pieces.
06:19 ingy I mean I'm inventing a whole new language
06:20 ingy well maybe you're a better programmer than I am
06:20 rking Nah, this is the opposite.
06:20 rking It's a tool to help us weak programmers get over big obstacles.
06:20 ingy what is?
06:20 ingy tdd?
06:21 rking Yeah
06:21 ingy I think it assumes you have a decent idea of where you are going
06:21 ingy usually a spec
06:21 ingy but maybe not
06:22 rking Some of that is bridged by SpikeSolutions
06:24 ingy ward and kent fly by the seat of their pants
06:24 ingy they just made that shit up
06:25 ingy ward for sure
06:25 rking Haha
06:25 rking It's still the best start I've heard
06:26 ingy ward's a smart cookie but he just does whatever makes sense, afaict
06:26 ingy he never once brought up tdd with me
06:27 ingy then again I forget everything
06:27 rking Probably because you exude anti-TDD vapors.
06:27 rking And he could detect that.
06:27 ingy nah
06:27 ingy ward roles like me
06:27 ingy rolls
06:27 ingy I'm not anti-tdd
06:28 ingy if I happen to be doing tdd, then it's all good