Guille
I think that we should also have a look at Xtreams and see if there is not
a core inside.
What I think that is that current stream implementation is quite terrible.
Stef
BTW we were discussing about deprecating Regexp and using a RePlugin to
bind to a default mainstream regexp expressions lib
so that people can use the same expressions that they are used to in Pharo.
Any ideas?
If this is important for you, you can help making it true.
Stef, we need to think about it carefullly. Streams are used in the
kernel for many tasks. Replacing them by a big framework will be a huge
drawback for bootstrapping purposes.
Alternatively, we could think of refactoring the kernel to not use
streams, but so far this is not possible...
On Sun, Jan 22, 2017 at 1:14 PM, Denis Kudriashov
wrote:
>
> 2017-01-22 11:54 GMT+01:00 Guillermo Polito :
>
>> Stef, we need to think about it carefullly. Streams are used in the
>> kernel for many tasks. Replacing them by a big framework will be a huge
>> drawback for bootstrapping purposes.
>>
2017-01-22 11:54 GMT+01:00 Guillermo Polito :
> Stef, we need to think about it carefullly. Streams are used in the kernel
> for many tasks. Replacing them by a big framework will be a huge drawback
> for bootstrapping purposes.
>
I would not say that Xtreams is bigger library then current stream
Stef, we need to think about it carefullly. Streams are used in the kernel
for many tasks. Replacing them by a big framework will be a huge drawback
for bootstrapping purposes.
Alternatively, we could think of refactoring the kernel to not use streams,
but so far this is not possible... the kernel
> Check some Perl code from a few years ago and come back with terseness and
> readability arguments. Yeah, sure.
I've been using Perl years ago. ;) When you are using it actively its very
compact syntax is very cool once it becomes habitual; but of course Perl is
write-only language.
But we ar
Reability: the more you read a language, the more you can read it.
And saying Python is super readable can have a look at how BSON is dealt
with in the MongoDB driver.
https://github.com/mongodb/mongo-python-driver/tree/master/bson
Now go check the same in MongoTalk. Where you can actually unders
Dtto as above. Readability was never a question. And if it was, then you
> just doubled the regex complexity, and made the code more confusing by
> turning the problem upside down, due to the limited API.
Complaining about the compact syntax makes as much sense as complaining
> that `1+2` is too
Yes I should finish to convert everything.
I hope that in Pharo 70 we will be able add Xtream like library and remove
the old stream
but this is large task.
stef
On Sat, 21 Jan 2017 21:06:34 +0100, p...@highoctane.be
wrote:
There is also this
https://github.com/SquareBracketAssociates
There is also this
https://github.com/SquareBracketAssociates/PharoLimbo/tree/master/Xtreams
On Sat, Jan 21, 2017 at 3:08 PM, Peter Uhnak wrote:
> On Sat, Jan 21, 2017 at 02:01:59PM +0100, Denis Kudriashov wrote:
> > Hi.
> >
> > 2017-01-20 16:15 GMT+01:00 Peter Uhnak :
> >
> > > In Ruby it is
Actually the things I snatched are from there.
Phil
On Sat, Jan 21, 2017 at 7:19 PM, Peter Uhnak wrote:
> On Sat, Jan 21, 2017 at 07:09:19PM +0100, Denis Kudriashov wrote:
> > 2017-01-21 17:09 GMT+01:00 p...@highoctane.be :
> >
> > > I collected some content about that and wanted to do somethin
On Sat, Jan 21, 2017 at 07:09:19PM +0100, Denis Kudriashov wrote:
> 2017-01-21 17:09 GMT+01:00 p...@highoctane.be :
>
> > I collected some content about that and wanted to do something about it
> > but, yeah, it got on the backburner.
> >
> > This is currently just the extract of the package comme
2017-01-21 17:09 GMT+01:00 p...@highoctane.be :
> I collected some content about that and wanted to do something about it
> but, yeah, it got on the backburner.
>
> This is currently just the extract of the package comment or something
> like that.
>
> https://github.com/philippeback/xstreamsdoc
>
I use PetitParser for this purpose.
It provides:
- an incremental way to build a parser especially when you use its bounded sea
abilities,
- a way to debug problems, and
- a reasonably readable outcome that can be extended to a more complicated
parser.
For example, in your case, you can use:
s
I collected some content about that and wanted to do something about it
but, yeah, it got on the backburner.
This is currently just the extract of the package comment or something like
that.
https://github.com/philippeback/xstreamsdoc
Phil
On Sat, Jan 21, 2017 at 3:08 PM, Peter Uhnak wrote:
>
On Sat, Jan 21, 2017 at 02:01:59PM +0100, Denis Kudriashov wrote:
> Hi.
>
> 2017-01-20 16:15 GMT+01:00 Peter Uhnak :
>
> > In Ruby it is dead simple:
> > str[/\[(.*)\]/,1].hex # "=> 37"
> >
>
> I always wondering when people think it is dead simple.
> I use streams for such cases. It is logical,
Nice one. str:= --> text :=
On Sat, Jan 21, 2017 at 10:07 AM, Dimitris Chloupis
wrote:
>
>> In Ruby it is dead simple:
>> str[/\[(.*)\]/,1].hex # "=> 37" , or .to_i(16)
>>
>
> and dead unreadable
>
> Pharo way is both dead simple and dead readable
>
> str:= ' Temperature 0 37C (9
Hi.
2017-01-20 16:15 GMT+01:00 Peter Uhnak :
> In Ruby it is dead simple:
> str[/\[(.*)\]/,1].hex # "=> 37"
>
I always wondering when people think it is dead simple.
I use streams for such cases. It is logical, readable and dead simple
approach without crappy syntax. And with Xtreams library it
>* I have to manually remove the 0x, even though it is a very common way of
>expressing hex numbers
Adding a few lines to NumberParser>>#nextNumber enables it to parse 0x...
---
((sourceStream peekFor: $r)) ifTrue: ["r"
...
]
ifFalse: [
(sourceStr
>
>
> In Ruby it is dead simple:
> str[/\[(.*)\]/,1].hex # "=> 37" , or .to_i(16)
>
and dead unreadable
Pharo way is both dead simple and dead readable
str:= ' Temperature 0 37C (98F) [0x25] (TMPIN0)'.
('16r',(text copyWithRegex: '(.*\[0x)|(\].*)' matchesReplacedWith: ''))
asNu
You can use #match and #upTo: on a ReadStream for easy extraction
| text digits|
text := ' Temperature 0 37C (98F) [0x25] (TMPIN0)'
digits:= text readStream match: '[0x' ; upTo: $].
( '16r' , digits ) asNumber "37"
---
22 matches
Mail list logo