Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Sep 23 22:26
    metasoarous commented #64
  • Sep 23 22:26
    metasoarous commented #64
  • May 04 06:50
    metasoarous closed #65
  • May 04 06:50
    metasoarous commented #65
  • May 04 06:44
    metasoarous edited #65
  • Nov 24 2020 18:28
    jumarko commented #70
  • Nov 18 2020 00:28
    metasoarous closed #61
  • Nov 18 2020 00:28
    metasoarous commented #61
  • Nov 17 2020 20:21
    metasoarous commented #65
  • Nov 17 2020 08:46
    ABeltramo commented #65
  • Nov 16 2020 23:59
    metasoarous commented #65
  • Nov 16 2020 14:39
    The-Alchemist commented #71
  • Nov 16 2020 05:24
    metasoarous commented #70
  • Nov 16 2020 05:23

    metasoarous on master

    Fix "introductory blog post" li… Merge branch 'master' into mast… Merge pull request #70 from jum… (compare)

  • Nov 16 2020 05:23
    metasoarous closed #70
  • Nov 16 2020 05:23
    metasoarous synchronize #70
  • Nov 16 2020 05:23
    metasoarous commented #71
  • Nov 16 2020 05:22

    metasoarous on master

    small typo fix Merge pull request #71 from The… (compare)

  • Nov 16 2020 05:22
    metasoarous closed #71
  • Nov 13 2020 17:54
    metasoarous commented #72
Benjamin Rosas
@ballPointPenguin
ok
Christopher Small
@metasoarous
Can just assume those are doubles as far as I'm concerned
Benjamin Rosas
@ballPointPenguin
I wanted to test the 2nd col gets cast as int if you sniff-lines 1-2, then maybe test the "error-handler" on the 3rd item in that case.
I mean the 3rd col
Christopher Small
@metasoarous
(in theory we could check to see if the precision would make them ints, but it's more trouble than it's worth for such a candy function like this)
Benjamin Rosas
@ballPointPenguin
"candy function" with sugar
Christopher Small
@metasoarous
Heheh
"curry function" with extra sauce
I would actually say that if there are any decimals, cast as doubles
Benjamin Rosas
@ballPointPenguin
sure
Christopher Small
@metasoarous
Even for the 1.0, 2.0, 3
Benjamin Rosas
@ballPointPenguin
That was my intention
Christopher Small
@metasoarous
If someone put those decimals in the file, it probably means they wanted them interpretted as doubles
Benjamin Rosas
@ballPointPenguin
agreed
Christopher Small
@metasoarous
If someone put a bunch of 12323,2872387,28937,...
Then we can assume they really wanted ints
In theory, we could let people specify their own sniffer configurations, but again... candy rots your teeth
Benjamin Rosas
@ballPointPenguin
and if (1 2 "three" 4 5), we can only assume String
Christopher Small
@metasoarous
Hahah
Yes...
We are not catering to that insanity
Benjamin Rosas
@ballPointPenguin
Well, if we attempt to "sniff" and there is a string in there, our sniff fails and we return all strings, no?
or, well, I guess that's up to the fail-handler
wait. the fail-handler only gets called if we sniff x rows and find a pattern, but then a row x + * does not conform. Something else happens if the sniff fails (we don't cast at all, I think).
Benjamin Rosas
@ballPointPenguin
ok so my test is failing how it should:
(not (= ("1" "2" "3") [1 2 3]))
now I just need to actually implement somehting...
Christopher Small
@metasoarous
Yes; the fail-handler would only get called after the first N rows have been "sniffed". And yes, if something doesn't match in the first N, we just leave them as strings and don't cast.
Awesome! Time to codez!
Benjamin Rosas
@ballPointPenguin
my impulse is to do something naive and OO-like. Thinking about a more lispy approach...
Christopher Small
@metasoarous
One thing you may not be aware of yet: The semantic-csv/impl/core.clj file is a space for implementation details. So anything you end up writing that isn't part of the core API (that is, that you would expect our users to call themselves) should go in there. If there is a bunch of such things, we could also add a semantic-csv/impl/sniffers.clj file/ns.
Benjamin Rosas
@ballPointPenguin
makes sense.
Christopher Small
@metasoarous
Just think about it as a bunch of functions
Benjamin Rosas
@ballPointPenguin
haha yeah. not that I have any other choice.
aren't we all, truly, just a bunch of functions?
Christopher Small
@metasoarous
Also, those things you put in semantic-csv.core.impl can be accessed in the main api namespace as impl/the-function-name
heheh
Benjamin Rosas
@ballPointPenguin
I see
Christopher Small
@metasoarous
Well, there are Records and Protocols
Could possibly use those
They carry some of the better patterns you get from OO in a rather clean and extensible way. There are some advantages to doing that, but for now, let's just keep things simple. As we refactor we can decide whether or not we want to do something fancy with those.
Benjamin Rosas
@ballPointPenguin
I need to learn more clojure.
I've heard good things.
Christopher Small
@metasoarous
:-)
Benjamin Rosas
@ballPointPenguin
as a last-ditch move before going off-grid, I MR'ed two failing-tests.
although you may chose to just close them, or write your own, or wait until I get back.
Wish I could have written some actual features or even a bug-fix :) but, it's been a good exercise nonetheless. Hopefully I'll have more momentum in a week.
Christopher Small
@metasoarous
Yo!
Just looked at that; thanks!
Left you a comment on GH in case you want to look at it