{"action":"created","issue":{"url":"https://api.github.com/repos/BioJulia/Bio.jl/issues/140","repository_url":"https://api.github.com/repos/BioJulia/Bio.jl","labels_url":"https://api.github.com/repos/BioJulia/Bio.jl/issues/140/labels{/name}","comments_url":"https://api.github.com/repos/BioJulia/Bio.jl/issues/140/comments","events_url":"https://api.github.com/repos/BioJulia/Bio.jl/issues/140/events","html_url":"https://github.com/BioJulia/Bio.jl/pull/140","id":141864782,"number":140,"title":"Refactor ragel","user":{"login":"bicycle1885","id":905683,"avatar_url":"https://avatars.githubusercontent.com/u/905683?v=3","gravatar_id":"","url":"https://api.github.com/users/bicycle1885","html_url":"https://github.com/bicycle1885","followers_url":"https://api.github.com/users/bicycle1885/followers","following_url":"https://api.github.com/users/bicycle1885/following{/other_user}","gists_url":"https://api.github.com/users/bicycle1885/gists{/gist_id}","starred_url":"https://api.github.com/users/bicycle1885/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bicycle1885/subscriptions","organizations_url":"https://api.github.com/users/bicycle1885/orgs","repos_url":"https://api.github.com/users/bicycle1885/repos","events_url":"https://api.github.com/users/bicycle1885/events{/privacy}","received_events_url":"https://api.github.com/users/bicycle1885/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/BioJulia/Bio.jl/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/BioJulia/Bio.jl/labels/stage:%20review","name":"stage: review","color":"c2e0c6"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2016-03-18T13:24:26Z","updated_at":"2016-05-08T05:40:17Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/BioJulia/Bio.jl/pulls/140","html_url":"https://github.com/BioJulia/Bio.jl/pull/140","diff_url":"https://github.com/BioJulia/Bio.jl/pull/140.diff","patch_url":"https://github.com/BioJulia/Bio.jl/pull/140.patch"},"body":"This is refactoring of Ragel code. src/Ragel.jl is shorter and `State` has less fields. I also added `@float64_from_anchor!` and `@ascii_from_anchor!` macros, which will be used in #138. \r\n\r\nNow `read!(input, output)` returns `output`, rather `true`/`false`. I think this is a better practice in Julia because `Base.read!` always returns the second argument. Instead, you can check the existence of remaining data by calling `eof` method. So you can write in-place parsing like:\r\n\r\n```julia\r\nstream = open(\"mini.fasta\", FASTA)\r\nseq = Seq.FASTASeqRecord()\r\nwhile !eof(stream)\r\n    read!(stream, seq)\r\n    println(seq)\r\nend\r\n```\r\n\r\n(EDIT: now I think the following is a separated issue and reverted the change; never mind)\r\n~~I also changed the method of printing formatted data. On master branch we use `Base.write` method but it is used for writing binary data.~~\r\n\r\n```\r\nhelp?> write\r\nsearch: write writedlm writecsv writemime readandwrite iswritable mimewritable\r\n\r\n  write(stream, x)\r\n\r\n  Write the canonical binary representation of a value to the given stream. Returns the\r\n  number of bytes written into the stream.\r\n\r\n  You can write multiple values with the same :func:write call. i.e. the following are\r\n  equivalent:\r\n\r\n  write(stream, x, y...)\r\n  write(stream, x) + write(stream, y...)\r\n```\r\n\r\n~~I think `print` is a suitable method for this purpose when printing human-readable text like FASTA, FASTQ, and BED. So, I changed it.~~"},"comment":{"url":"https://api.github.com/repos/BioJulia/Bio.jl/issues/comments/217692520","html_url":"https://github.com/BioJulia/Bio.jl/pull/140#issuecomment-217692520","issue_url":"https://api.github.com/repos/BioJulia/Bio.jl/issues/140","id":217692520,"user":{"login":"bicycle1885","id":905683,"avatar_url":"https://avatars.githubusercontent.com/u/905683?v=3","gravatar_id":"","url":"https://api.github.com/users/bicycle1885","html_url":"https://github.com/bicycle1885","followers_url":"https://api.github.com/users/bicycle1885/followers","following_url":"https://api.github.com/users/bicycle1885/following{/other_user}","gists_url":"https://api.github.com/users/bicycle1885/gists{/gist_id}","starred_url":"https://api.github.com/users/bicycle1885/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bicycle1885/subscriptions","organizations_url":"https://api.github.com/users/bicycle1885/orgs","repos_url":"https://api.github.com/users/bicycle1885/repos","events_url":"https://api.github.com/users/bicycle1885/events{/privacy}","received_events_url":"https://api.github.com/users/bicycle1885/received_events","type":"User","site_admin":false},"created_at":"2016-05-08T05:40:17Z","updated_at":"2016-05-08T05:40:17Z","body":"I will merge this if nobody blocks me today."}}