Pharo-users
By thread
pharo-users@lists.pharo.org
By month
Messages by month
- ----- 2026 -----
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
December 2020
- 37 participants
- 108 messages
Re: Magritte
by Sebastián Filippini
Please!
I have only seen examples with seaside. Could you add any desktop app
example?
Thanks.
Sebastián
El 4/12/20 a las 21:19, Stéphane Ducasse escribió:
> Hi Sean
>
> May be we should update the Magrrite booklet. I never got the time to
> go over it.
>
> S.
>
>> On 23 Nov 2020, at 15:56, Sean P. DeNigris <sean(a)clipperadams.com
>> <mailto:sean@clipperadams.com>> wrote:
>>
>> Sanjay Minni wrote
>>> Is Magritte a robust enough package for an application with a large
>>> number
>>> of forms and sub forms.
>>
>> I use Magritte extensively (for almost all my projects), and have
>> found it
>> irreplaceable, but nearly all in desktop apps. Maybe cross-post to the
>> Seaside list if you don't get an answer here...
>>
>>
>>
>> -----
>> Cheers,
>> Sean
>> --
>> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
>
> --------------------------------------------
> Stéphane Ducasse
> http://stephane.ducasse.free.fr / http://www.pharo.org
> 03 59 35 87 52
> Assistant: Aurore Dalle
> FAX 03 59 57 78 50
> TEL 03 59 35 86 16
> S. Ducasse - Inria
> 40, avenue Halley,
> Parc Scientifique de la Haute Borne, Bât.A, Park Plaza
> Villeneuve d'Ascq 59650
> France
>
Dec. 7, 2020
Re: (Re)storing code blocks from text strings (hopefully in STON)
by Offray Vladimir Luna Cárdenas
Hi,
I have was able to implement Sven's suggestion and it worked pretty well
regarding the serialization of objects containing clean blocks, as you
can see on [1].
[1] https://mutabit.com/repos.fossil/dots/file?name=brea/theme.ston&ci=trunk
A Brea theme is now represented in a pretty light weight way as a STON
text file containing a base theme (taken from HTML5Up [2], for now),
with name, provider, license and preview, a folder with customizations
to that theme (mostly by adding Mustache[3] templates to particular base
theme locations) and a set of operations which are mainly clean blocks
with a name, modeled as BreaOperators, that will be chained in a
particular order to update parts or all the website. Once the site has
been updated Fossil is used to store, publish, distribute and versioning
the web site, allowing us time travel back to or restore a previous
version, provides a JSON API to query website repository's data, and
could allow us to collect some date (issues, forms, comments). The
combination of Pharo and Fossil creates a pretty versatile light
solution that is kind of in between a Static Site Generator and a
headless Content Management System thanks to the way we can manage
static assets and also live code queries or extend data models and
operations. I'm pretty happy with the possibilities shown by this early
prototype.
[2] https://html5up.net/
[3] https://mustache.github.io/
I imagine that there is a way to extend STON to do pretty printing of
serialized blocks (I will try to locate some time to experiment on this
later, as I'm still finishing bureaucratic paperwork and year's end
deadlines with urgent stuff taking time from important one). But I just
want to show how cool is STON supporting these use cases and say thanks
again for making such endorphins enhancer digital tech! ( â(ï½¥oï½¥)ââªâ
(ï½¥oï½¥) â).
Finally on Stephen's idea of pull request to Sven's STON booklet, I
don't think that I have enough knowledge to make a significant
contribution, beyond typos I can find as a non-native, mostly
self-taught English "speaker". But I will be glad to make contributions
to some "Use Case Appendix", briefly showcasing how STON has been a
powerful enabler for Grafoscopio's interactive notebooks and now for
Brea's theme definition, including data operations and transformations.
Cheers,
Offray
On 1/12/20 10:08 a. m., Offray Vladimir Luna Cárdenas wrote:
> Hi Sven,
>
> Thanks for your swift and useful response as usual and yes, not only it
> helps a lot but teach too (as usual with your answers).
>
> I will be dealing with some bureaucratic last minute, hard deadline
> notification I just got yesterday from my university (following local
> "tradition" in public institutions of total disregard of everybody's
> schedule and time)... Anyway, I will be having opportunity to test your
> suggestions until next week, after deadline.
>
> I understand the concerns about not serializing code blocks. So far they
> have not been a necessity for me (as code snippets are stored as
> "playground trees" in the Grafoscopio notebooks), but I would like to
> explore this approach before considering something more complex (like
> Metacello/Iceberg packages for the Brea web themes).
>
> I have been using some minor modifications on objects to serialize them,
> mainly to store playground contents as strings, and they have worked
> fine until now, but I was learning all along the way and they could be
> just a not good practice from my file scripting times/needs.
>
> Cheers,
>
> Offray
>
> On 1/12/20 4:54 a. m., Sven Van Caekenberghe wrote:
>> Hi Offray,
>>
>> This is a recurring question. BlockClosures are way too general and powerful to be serialised. That is why serialising BlockClosures is not supported in STON.
>>
>> The code inside a block can refer to and even affect state outside the block. Furthermore the return operator is quite special as it returns from some outer context.
>>
>> A subset of BlockClosures are those that are clean. These do not close over other variables, nor do they contain a return. By using their source code representation, it is possible to serialise/materialise them.
>>
>> You can try this by adding the following methods:
>>
>> BlockClosure>>#stonOn: stonWriter
>> self isClean
>> ifTrue: [ stonWriter writeObject: self listSingleton: self printString ]
>> ifFalse: [ stonWriter error: 'Only clean blocks can be serialized' ]
>>
>> BlockClosure>>#stonContainSubObjects
>> ^ false
>>
>> BlockClosure class>>#fromSton: stonReader
>> ^ self compilerClass new
>> source: stonReader parseListSingleton;
>> evaluate
>>
>> With these additions you can do the following:
>>
>> STON fromString: (STON toString: [ :x :y | x + y ]).
>>
>> Note that the actual class name depends on the Pharo version (BlockClosure in Pharo 7, FullBlockClosure in Pharo 9 and maybe soon CleanBlockClosure - Marcus is working on that last one and that would be very cool because it would say exactly what it it).
>>
>> I am still not 100% convinced to add this as a standard feature to STON. Using source code fully exposes the implementation, while using the compiler can be dangerous. It also adds a dependency on source code and the compiler. But it would be good if people can experiment with this feature.
>>
>> Does this help you ?
>>
>> Regards,
>>
>> Sven
>>
>> PS: I would not modify an object just to serialise it.
>>
>>> On 30 Nov 2020, at 18:19, Offray Vladimir Luna Cárdenas <offray.luna(a)mutabit.com> wrote:
>>>
>>> Hi,
>>>
>>> I'm using STON for all my light storage serialization needs, like the
>>> Grafoscopio notebooks, and I also love it, as Russ stated in their mail
>>> question, and I share with him a similar request: for my Brea[1] static
>>> site generator I would like to store some BreaQuery objects as external
>>> STON files, and recover them, so I can run the queries that
>>> recreate/update the website easily. I could store them as Grafoscopio
>>> notebooks, but I don't want to make Grafoscopio a prerequisite for Brea
>>> or I could use Fuel, but I would like to store queries as a diff
>>> friendly text based format. I have considered Metacello/Iceberg packages
>>> to export code in a diff friendly format, but It maybe overkill. So I
>>> would like to see if STON can serve me here too.
>>>
>>> [1] https://mutabit.com/repos.fossil/brea/
>>> [2] https://mutabit.com/repos.fossil/indieweb/
>>>
>>> So far, I'm able to serialize a code block as a string using:
>>>
>>> BreaQuery>>asStonModified
>>> self codeBlock: self codeBlock asString
>>> ^ STON toStringPretty: self
>>>
>>> But I'm unable to populate a block from a string. There is any way to
>>> make a string, lets say 'a + b', to become the code contents of a block,
>>> ie: [a + b ] ?
>>>
>>> Thanks,
>>>
>>> Offray
>>>
Dec. 6, 2020
Re: SmalltalkCI / Github Actions
by Stéphane Ducasse
Thanks I thought that the os should be defined as matrix but this not case
S
name: PharoVersion
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
on:
push:
branches:
- master
jobs:
build:
runs-on: [ ubuntu-latest, mac-latest ]
strategy:
matrix:
smalltalk: [ Pharo64-8.0, Pharo64-9.0 ]
name: ${{ matrix.smalltalk }}
steps:
- uses: actions/checkout@v2
- uses: hpi-swa/setup-smalltalkCI@v1
with:
smalltalk-version: ${{ matrix.smalltalk }}
- name: Load Image and Run Tests
run: smalltalkci -s ${{ matrix.smalltalk }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
timeout-minutes: 15
Dec. 5, 2020
Re: SmalltalkCI / Github Actions
by Stéphane Ducasse
THANKS!!!!
> On 1 Dec 2020, at 22:46, Gabriel Cotelli <g.cotelli(a)gmail.com> wrote:
>
> Take a look at https://github.com/ba-st/Buoy/blob/release-candidate/.github/workflows/buil… <https://github.com/ba-st/Buoy/blob/release-candidate/.github/workflows/buil…>
> On Tue, Dec 1, 2020, 13:18 Stéphane Ducasse <stephane.ducasse(a)inria.fr <mailto:stephane.ducasse@inria.fr>> wrote:
> Hi
>
> I have a question and I could not find the answer in the SmalltalkCI doc
> I would like to run my tests on different versions of Pharo
> I know how to do it in travis but in GA I missed it.
>
> I read
> https://github.com/marketplace/actions/setup-smalltalkci <https://github.com/marketplace/actions/setup-smalltalkci>
> and tutorials on the net about GA
>
> So I tried
>
> name: test
>
> env:
> GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
>
> on:
> push:
> branches:
> - master
>
> jobs:
> build:
> strategy:
> fail-fast: false
> matrix:
> platform: [ubuntu-latest, macos-latest ]
> pharoversion: [Pharo64-8.0, Pharo64-9.0]
> runs-on: ${{ matrix.platform }}
> steps:
> - uses: actions/checkout@v2
> - uses: hpi-swa/setup-smalltalkCI@v1
> id: smalltalkci
> with:
> smalltalk-version: pharoversion
> - run: smalltalkci -s ${{ steps.smalltalkci.outputs.pharoversion }}
> shell: bash
> timeout-minutes: 15
>
>
> but it failed.
> I do not know how to specify the version of Pharo64-8.0 on mac.
>
> S.
>
> --------------------------------------------
> Stéphane Ducasse
> http://stephane.ducasse.free.fr <http://stephane.ducasse.free.fr/> / http://www.pharo.org <http://www.pharo.org/>
> 03 59 35 87 52
> Assistant: Aurore Dalle
> FAX 03 59 57 78 50
> TEL 03 59 35 86 16
> S. Ducasse - Inria
> 40, avenue Halley,
> Parc Scientifique de la Haute Borne, Bât.A, Park Plaza
> Villeneuve d'Ascq 59650
> France
>
--------------------------------------------
Stéphane Ducasse
http://stephane.ducasse.free.fr / http://www.pharo.org
03 59 35 87 52
Assistant: Aurore Dalle
FAX 03 59 57 78 50
TEL 03 59 35 86 16
S. Ducasse - Inria
40, avenue Halley,
Parc Scientifique de la Haute Borne, Bât.A, Park Plaza
Villeneuve d'Ascq 59650
France
Dec. 5, 2020
Re: (Re)storing code blocks from text strings (hopefully in STON)
by Stéphane Ducasse
and you can send PR to improve it :)
> On 5 Dec 2020, at 00:23, Offray Vladimir Luna Cárdenas <offray.luna(a)mutabit.com> wrote:
>
> Ohhh :-O ... where is the STON booklet. I would love to read it.
>
> Thanks,
>
> Offray
>
> On 4/12/20 3:24 p. m., Stéphane Ducasse wrote:
>> Done :)
>>
>>
>>> On 4 Dec 2020, at 21:20, Stéphane Ducasse <stephane.ducasse(a)inria.fr <mailto:stephane.ducasse@inria.fr>> wrote:
>>>
>>> It looks like it is recurring enough to be part of the Ston booklet :)
>>>
>>> I will add it.
>>>
>>> S.
>>>
>>>> On 1 Dec 2020, at 10:54, Sven Van Caekenberghe <sven(a)stfx.eu <mailto:sven@stfx.eu>> wrote:
>>>>
>>>> Hi Offray,
>>>>
>>>> This is a recurring question. BlockClosures are way too general and powerful to be serialised. That is why serialising BlockClosures is not supported in STON.
>>>>
>>>> The code inside a block can refer to and even affect state outside the block. Furthermore the return operator is quite special as it returns from some outer context.
>>>>
>>>> A subset of BlockClosures are those that are clean. These do not close over other variables, nor do they contain a return. By using their source code representation, it is possible to serialise/materialise them.
>>>>
>>>> You can try this by adding the following methods:
>>>>
>>>> BlockClosure>>#stonOn: stonWriter
>>>> self isClean
>>>> ifTrue: [ stonWriter writeObject: self listSingleton: self printString ]
>>>> ifFalse: [ stonWriter error: 'Only clean blocks can be serialized' ]
>>>>
>>>> BlockClosure>>#stonContainSubObjects
>>>> ^ false
>>>>
>>>> BlockClosure class>>#fromSton: stonReader
>>>> ^ self compilerClass new
>>>> source: stonReader parseListSingleton;
>>>> evaluate
>>>>
>>>> With these additions you can do the following:
>>>>
>>>> STON fromString: (STON toString: [ :x :y | x + y ]).
>>>>
>>>> Note that the actual class name depends on the Pharo version (BlockClosure in Pharo 7, FullBlockClosure in Pharo 9 and maybe soon CleanBlockClosure - Marcus is working on that last one and that would be very cool because it would say exactly what it it).
>>>>
>>>> I am still not 100% convinced to add this as a standard feature to STON. Using source code fully exposes the implementation, while using the compiler can be dangerous. It also adds a dependency on source code and the compiler. But it would be good if people can experiment with this feature.
>>>>
>>>> Does this help you ?
>>>>
>>>> Regards,
>>>>
>>>> Sven
>>>>
>>>> PS: I would not modify an object just to serialise it.
>>>>
>>>>> On 30 Nov 2020, at 18:19, Offray Vladimir Luna Cárdenas <offray.luna(a)mutabit.com <mailto:offray.luna@mutabit.com>> wrote:
>>>>>
>>>>> Hi,
>>>>>
>>>>> I'm using STON for all my light storage serialization needs, like the
>>>>> Grafoscopio notebooks, and I also love it, as Russ stated in their mail
>>>>> question, and I share with him a similar request: for my Brea[1] static
>>>>> site generator I would like to store some BreaQuery objects as external
>>>>> STON files, and recover them, so I can run the queries that
>>>>> recreate/update the website easily. I could store them as Grafoscopio
>>>>> notebooks, but I don't want to make Grafoscopio a prerequisite for Brea
>>>>> or I could use Fuel, but I would like to store queries as a diff
>>>>> friendly text based format. I have considered Metacello/Iceberg packages
>>>>> to export code in a diff friendly format, but It maybe overkill. So I
>>>>> would like to see if STON can serve me here too.
>>>>>
>>>>> [1] https://mutabit.com/repos.fossil/brea/ <https://mutabit.com/repos.fossil/brea/>
>>>>> [2] https://mutabit.com/repos.fossil/indieweb/ <https://mutabit.com/repos.fossil/indieweb/>
>>>>>
>>>>> So far, I'm able to serialize a code block as a string using:
>>>>>
>>>>> BreaQuery>>asStonModified
>>>>> self codeBlock: self codeBlock asString
>>>>> ^ STON toStringPretty: self
>>>>>
>>>>> But I'm unable to populate a block from a string. There is any way to
>>>>> make a string, lets say 'a + b', to become the code contents of a block,
>>>>> ie: [a + b ] ?
>>>>>
>>>>> Thanks,
>>>>>
>>>>> Offray
>>>>>
>>>
>>> --------------------------------------------
>>> Stéphane Ducasse
>>> http://stephane.ducasse.free.fr <http://stephane.ducasse.free.fr/> / http://www.pharo.org <http://www.pharo.org/>
>>> 03 59 35 87 52
>>> Assistant: Aurore Dalle
>>> FAX 03 59 57 78 50
>>> TEL 03 59 35 86 16
>>> S. Ducasse - Inria
>>> 40, avenue Halley,
>>> Parc Scientifique de la Haute Borne, Bât.A, Park Plaza
>>> Villeneuve d'Ascq 59650
>>> France
>>>
>>
>> --------------------------------------------
>> Stéphane Ducasse
>> http://stephane.ducasse.free.fr <http://stephane.ducasse.free.fr/> / http://www.pharo.org <http://www.pharo.org/>
>> 03 59 35 87 52
>> Assistant: Aurore Dalle
>> FAX 03 59 57 78 50
>> TEL 03 59 35 86 16
>> S. Ducasse - Inria
>> 40, avenue Halley,
>> Parc Scientifique de la Haute Borne, Bât.A, Park Plaza
>> Villeneuve d'Ascq 59650
>> France
>>
--------------------------------------------
Stéphane Ducasse
http://stephane.ducasse.free.fr / http://www.pharo.org
03 59 35 87 52
Assistant: Aurore Dalle
FAX 03 59 57 78 50
TEL 03 59 35 86 16
S. Ducasse - Inria
40, avenue Halley,
Parc Scientifique de la Haute Borne, Bât.A, Park Plaza
Villeneuve d'Ascq 59650
France
Dec. 5, 2020
Re: [Video] Transforming code using RewriteToolsSet
by Noury Bouraqadi
+1
On Dec 4 2020, at 9:25 pm, Stéphane Ducasse <stephane.ducasse(a)inria.fr> wrote:
> I want it as part of new tools :)
>
> S
>
> > On 2 Dec 2020, at 16:14, Sebastian Jordan <sebastianjmt(a)hotmail.com (mailto:sebastianjmt@hotmail.com)> wrote:
> > Hi,
> > If you are interested in applying custom code transformations on a selected set of classes, maybe this tool will be of your interest. I made these mini-tutorial-videos in which I transform the code of a set of classes through a transformation rule using this brand new tool RewriteToolsSet.
> >
> > Thanks!
> >
> > [GitHub's repo: https://github.com/jordanmontt/RewriteToolsSet]
> >
> > - https://www.youtube.com/watch?v=M0ElVhUoWXk
> > - https://www.youtube.com/watch?v=_9v1XTk1J2A
> >
> >
> >
> > Transforming code using RewriteToolsSet (https://www.youtube.com/watch?v=M0ElVhUoWXk)
> > In this video we are going to see another common use case of this set of tools. We are going to reactor the code of all classes of a package using a transformation rule. If you have any question or experience any bug, please do not hesitate open an issue on the GitHub page or contact me. Thank you for you time! GitHub's repository: https ...
> > www.youtube.com (http://www.youtube.com/)
> >
> >
> >
> >
> >
> >
> >
> >
> >
>
>
>
> --------------------------------------------
> Stéphane Ducasse
> http://stephane.ducasse.free.fr / http://www.pharo.org
> 03 59 35 87 52
> Assistant: Aurore Dalle
> FAX 03 59 57 78 50
> TEL 03 59 35 86 16
> S. Ducasse - Inria
> 40, avenue Halley,
> Parc Scientifique de la Haute Borne, Bât.A, Park Plaza
> Villeneuve d'Ascq 59650
> France
>
>
>
>
>
>
>
>
>
Dec. 5, 2020
Re: (Re)storing code blocks from text strings (hopefully in STON)
by Sven Van Caekenberghe
https://github.com/SquareBracketAssociates/Booklet-STON/releases/tag/contin…
> On 5 Dec 2020, at 00:23, Offray Vladimir Luna Cárdenas <offray.luna(a)mutabit.com> wrote:
>
> Ohhh :-O ... where is the STON booklet. I would love to read it.
>
> Thanks,
>
> Offray
>
> On 4/12/20 3:24 p. m., Stéphane Ducasse wrote:
>> Done :)
>>
>>
>>> On 4 Dec 2020, at 21:20, Stéphane Ducasse <stephane.ducasse(a)inria.fr> wrote:
>>>
>>> It looks like it is recurring enough to be part of the Ston booklet :)
>>>
>>> I will add it.
>>>
>>> S.
>>>
>>>> On 1 Dec 2020, at 10:54, Sven Van Caekenberghe <sven(a)stfx.eu> wrote:
>>>>
>>>> Hi Offray,
>>>>
>>>> This is a recurring question. BlockClosures are way too general and powerful to be serialised. That is why serialising BlockClosures is not supported in STON.
>>>>
>>>> The code inside a block can refer to and even affect state outside the block. Furthermore the return operator is quite special as it returns from some outer context.
>>>>
>>>> A subset of BlockClosures are those that are clean. These do not close over other variables, nor do they contain a return. By using their source code representation, it is possible to serialise/materialise them.
>>>>
>>>> You can try this by adding the following methods:
>>>>
>>>> BlockClosure>>#stonOn: stonWriter
>>>> self isClean
>>>> ifTrue: [ stonWriter writeObject: self listSingleton: self printString ]
>>>> ifFalse: [ stonWriter error: 'Only clean blocks can be serialized' ]
>>>>
>>>> BlockClosure>>#stonContainSubObjects
>>>> ^ false
>>>>
>>>> BlockClosure class>>#fromSton: stonReader
>>>> ^ self compilerClass new
>>>> source: stonReader parseListSingleton;
>>>> evaluate
>>>>
>>>> With these additions you can do the following:
>>>>
>>>> STON fromString: (STON toString: [ :x :y | x + y ]).
>>>>
>>>> Note that the actual class name depends on the Pharo version (BlockClosure in Pharo 7, FullBlockClosure in Pharo 9 and maybe soon CleanBlockClosure - Marcus is working on that last one and that would be very cool because it would say exactly what it it).
>>>>
>>>> I am still not 100% convinced to add this as a standard feature to STON. Using source code fully exposes the implementation, while using the compiler can be dangerous. It also adds a dependency on source code and the compiler. But it would be good if people can experiment with this feature.
>>>>
>>>> Does this help you ?
>>>>
>>>> Regards,
>>>>
>>>> Sven
>>>>
>>>> PS: I would not modify an object just to serialise it.
>>>>
>>>>> On 30 Nov 2020, at 18:19, Offray Vladimir Luna Cárdenas <offray.luna(a)mutabit.com> wrote:
>>>>>
>>>>> Hi,
>>>>>
>>>>> I'm using STON for all my light storage serialization needs, like the
>>>>> Grafoscopio notebooks, and I also love it, as Russ stated in their mail
>>>>> question, and I share with him a similar request: for my Brea[1] static
>>>>> site generator I would like to store some BreaQuery objects as external
>>>>> STON files, and recover them, so I can run the queries that
>>>>> recreate/update the website easily. I could store them as Grafoscopio
>>>>> notebooks, but I don't want to make Grafoscopio a prerequisite for Brea
>>>>> or I could use Fuel, but I would like to store queries as a diff
>>>>> friendly text based format. I have considered Metacello/Iceberg packages
>>>>> to export code in a diff friendly format, but It maybe overkill. So I
>>>>> would like to see if STON can serve me here too.
>>>>>
>>>>> [1] https://mutabit.com/repos.fossil/brea/
>>>>> [2] https://mutabit.com/repos.fossil/indieweb/
>>>>>
>>>>> So far, I'm able to serialize a code block as a string using:
>>>>>
>>>>> BreaQuery>>asStonModified
>>>>> self codeBlock: self codeBlock asString
>>>>> ^ STON toStringPretty: self
>>>>>
>>>>> But I'm unable to populate a block from a string. There is any way to
>>>>> make a string, lets say 'a + b', to become the code contents of a block,
>>>>> ie: [a + b ] ?
>>>>>
>>>>> Thanks,
>>>>>
>>>>> Offray
>>>>>
>>>
>>> --------------------------------------------
>>> Stéphane Ducasse
>>> http://stephane.ducasse.free.fr / http://www.pharo.org
>>> 03 59 35 87 52
>>> Assistant: Aurore Dalle
>>> FAX 03 59 57 78 50
>>> TEL 03 59 35 86 16
>>> S. Ducasse - Inria
>>> 40, avenue Halley,
>>> Parc Scientifique de la Haute Borne, Bât.A, Park Plaza
>>> Villeneuve d'Ascq 59650
>>> France
>>>
>>
>> --------------------------------------------
>> Stéphane Ducasse
>> http://stephane.ducasse.free.fr / http://www.pharo.org
>> 03 59 35 87 52
>> Assistant: Aurore Dalle
>> FAX 03 59 57 78 50
>> TEL 03 59 35 86 16
>> S. Ducasse - Inria
>> 40, avenue Halley,
>> Parc Scientifique de la Haute Borne, Bât.A, Park Plaza
>> Villeneuve d'Ascq 59650
>> France
>>
Dec. 5, 2020
Re: (Re)storing code blocks from text strings (hopefully in STON)
by Offray Vladimir Luna Cárdenas
Ohhh :-O ... where is the STON booklet. I would love to read it.
Thanks,
Offray
On 4/12/20 3:24 p. m., Stéphane Ducasse wrote:
> Done :)
>
>
>> On 4 Dec 2020, at 21:20, Stéphane Ducasse <stephane.ducasse(a)inria.fr
>> <mailto:stephane.ducasse@inria.fr>> wrote:
>>
>> It looks like it is recurring  enough to be part of the Ston booklet :)
>>
>> I will add it.Â
>>
>> S.Â
>>
>>> On 1 Dec 2020, at 10:54, Sven Van Caekenberghe <sven(a)stfx.eu
>>> <mailto:sven@stfx.eu>> wrote:
>>>
>>> Hi Offray,
>>>
>>> This is a recurring question. BlockClosures are way too general and
>>> powerful to be serialised. That is why serialising BlockClosures is
>>> not supported in STON.
>>>
>>> The code inside a block can refer to and even affect state outside
>>> the block. Furthermore the return operator is quite special as it
>>> returns from some outer context.
>>>
>>> A subset of BlockClosures are those that are clean. These do not
>>> close over other variables, nor do they contain a return. By using
>>> their source code representation, it is possible to
>>> serialise/materialise them.
>>>
>>> You can try this by adding the following methods:
>>>
>>> BlockClosure>>#stonOn: stonWriter
>>> Â self isClean
>>> Â Â Â ifTrue: [ stonWriter writeObject: self listSingleton: self
>>> printString ]
>>> Â Â Â ifFalse: [ stonWriter error: 'Only clean blocks can be serialized' ]
>>>
>>> BlockClosure>>#stonContainSubObjects
>>> Â ^ false
>>>
>>> BlockClosure class>>#fromSton: stonReader
>>> Â ^ self compilerClass new
>>> Â Â Â Â Â source: stonReader parseListSingleton;
>>> Â Â Â Â Â evaluate
>>>
>>> With these additions you can do the following:
>>>
>>> Â STON fromString: (STON toString: [ :x :y | x + y ]).
>>>
>>> Note that the actual class name depends on the Pharo version
>>> (BlockClosure in Pharo 7, FullBlockClosure in Pharo 9 and maybe soon
>>> CleanBlockClosure - Marcus is working on that last one and that
>>> would be very cool because it would say exactly what it it).
>>>
>>> I am still not 100% convinced to add this as a standard feature to
>>> STON. Using source code fully exposes the implementation, while
>>> using the compiler can be dangerous. It also adds a dependency on
>>> source code and the compiler. But it would be good if people can
>>> experiment with this feature.
>>>
>>> Does this help you ?
>>>
>>> Regards,
>>>
>>> Sven
>>>
>>> PS: I would not modify an object just to serialise it.
>>>
>>>> On 30 Nov 2020, at 18:19, Offray Vladimir Luna Cárdenas
>>>> <offray.luna(a)mutabit.com <mailto:offray.luna@mutabit.com>> wrote:
>>>>
>>>> Hi,
>>>>
>>>> I'm using STON for all my light storage serialization needs, like the
>>>> Grafoscopio notebooks, and I also love it, as Russ stated in their mail
>>>> question, and I share with him a similar request: for my Brea[1] static
>>>> site generator I would like to store some BreaQuery objects as external
>>>> STON files, and recover them, so I can run the queries that
>>>> recreate/update the website easily. I could store them as Grafoscopio
>>>> notebooks, but I don't want to make Grafoscopio a prerequisite for Brea
>>>> or I could use Fuel, but I would like to store queries as a diff
>>>> friendly text based format. I have considered Metacello/Iceberg
>>>> packages
>>>> to export code in a diff friendly format, but It maybe overkill. So I
>>>> would like to see if STON can serve me here too.
>>>>
>>>> [1] https://mutabit.com/repos.fossil/brea/
>>>> <https://mutabit.com/repos.fossil/brea/>
>>>> [2] https://mutabit.com/repos.fossil/indieweb/
>>>> <https://mutabit.com/repos.fossil/indieweb/>
>>>>
>>>> So far, I'm able to serialize a code block as a string using:
>>>>
>>>> BreaQuery>>asStonModified
>>>> Â Â Â self codeBlock: self codeBlock asString
>>>> Â Â Â ^ STON toStringPretty: self
>>>>
>>>> But I'm unable to populate a block from a string. There is any way to
>>>> make a string, lets say 'a + b', to become the code contents of a
>>>> block,
>>>> ie: [a + b ] ?
>>>>
>>>> Thanks,
>>>>
>>>> Offray
>>>>
>>
>> --------------------------------------------
>> Stéphane Ducasse
>> http://stephane.ducasse.free.fr <http://stephane.ducasse.free.fr/> /
>> http://www.pharo.org <http://www.pharo.org/>Â
>> 03 59 35 87 52
>> Assistant: Aurore DalleÂ
>> FAX 03 59 57 78 50
>> TEL 03 59 35 86 16
>> S. Ducasse - Inria
>> 40, avenue Halley,Â
>> Parc Scientifique de la Haute Borne, Bât.A, Park Plaza
>> Villeneuve d'Ascq 59650
>> France
>>
>
> --------------------------------------------
> Stéphane Ducasse
> http://stephane.ducasse.free.fr <http://stephane.ducasse.free.fr> /
> http://www.pharo.org <http://www.pharo.org>Â
> 03 59 35 87 52
> Assistant: Aurore DalleÂ
> FAX 03 59 57 78 50
> TEL 03 59 35 86 16
> S. Ducasse - Inria
> 40, avenue Halley,Â
> Parc Scientifique de la Haute Borne, Bât.A, Park Plaza
> Villeneuve d'Ascq 59650
> France
>
Dec. 4, 2020
Re: [Pharo Mooc] Change colors of test results
by Stéphane Ducasse
sergio
please let us know how e can proceed because we could do a theme for colorblind people.
S
> On 19 Nov 2020, at 02:12, sergio ruiz <sergio.rrd(a)gmail.com> wrote:
>
> Hey, all..
>
> I am taking the Pharo Mooc, and was wondering:
>
> is there any way to change the color next to the test method name?
>
> I am colorblind, and I canât tell the different between green and yellow.
>
> Thanks!
>
>
> ----
> peace,
> sergio
> photographer, journalist, visionary
>
> Public Key: https://pgp.key-server.io/pks/lookup?op=get&search=0x69B08F58923AB3A2 <https://pgp.key-server.io/pks/lookup?op=get&search=0x69B08F58923AB3A2>
> #BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV
> @sergio_101@mastodon.social <mailto:sergio_101@mastodon.social>
> https://sergio101.com <https://sergio101.com/>
> http://www.codeandmusic.com
> http://www.twitter.com/sergio_101
> http://www.facebook.com/sergio101
>
--------------------------------------------
Stéphane Ducasse
http://stephane.ducasse.free.fr / http://www.pharo.org
03 59 35 87 52
Assistant: Aurore Dalle
FAX 03 59 57 78 50
TEL 03 59 35 86 16
S. Ducasse - Inria
40, avenue Halley,
Parc Scientifique de la Haute Borne, Bât.A, Park Plaza
Villeneuve d'Ascq 59650
France
Dec. 4, 2020
Re: (Re)storing code blocks from text strings (hopefully in STON)
by Sven Van Caekenberghe
Thx!
> On 4 Dec 2020, at 21:24, Stéphane Ducasse <stephane.ducasse(a)inria.fr> wrote:
>
> Done :)
>
>
>> On 4 Dec 2020, at 21:20, Stéphane Ducasse <stephane.ducasse(a)inria.fr> wrote:
>>
>> It looks like it is recurring enough to be part of the Ston booklet :)
>>
>> I will add it.
>>
>> S.
>>
>>> On 1 Dec 2020, at 10:54, Sven Van Caekenberghe <sven(a)stfx.eu> wrote:
>>>
>>> Hi Offray,
>>>
>>> This is a recurring question. BlockClosures are way too general and powerful to be serialised. That is why serialising BlockClosures is not supported in STON.
>>>
>>> The code inside a block can refer to and even affect state outside the block. Furthermore the return operator is quite special as it returns from some outer context.
>>>
>>> A subset of BlockClosures are those that are clean. These do not close over other variables, nor do they contain a return. By using their source code representation, it is possible to serialise/materialise them.
>>>
>>> You can try this by adding the following methods:
>>>
>>> BlockClosure>>#stonOn: stonWriter
>>> self isClean
>>> ifTrue: [ stonWriter writeObject: self listSingleton: self printString ]
>>> ifFalse: [ stonWriter error: 'Only clean blocks can be serialized' ]
>>>
>>> BlockClosure>>#stonContainSubObjects
>>> ^ false
>>>
>>> BlockClosure class>>#fromSton: stonReader
>>> ^ self compilerClass new
>>> source: stonReader parseListSingleton;
>>> evaluate
>>>
>>> With these additions you can do the following:
>>>
>>> STON fromString: (STON toString: [ :x :y | x + y ]).
>>>
>>> Note that the actual class name depends on the Pharo version (BlockClosure in Pharo 7, FullBlockClosure in Pharo 9 and maybe soon CleanBlockClosure - Marcus is working on that last one and that would be very cool because it would say exactly what it it).
>>>
>>> I am still not 100% convinced to add this as a standard feature to STON. Using source code fully exposes the implementation, while using the compiler can be dangerous. It also adds a dependency on source code and the compiler. But it would be good if people can experiment with this feature.
>>>
>>> Does this help you ?
>>>
>>> Regards,
>>>
>>> Sven
>>>
>>> PS: I would not modify an object just to serialise it.
>>>
>>>> On 30 Nov 2020, at 18:19, Offray Vladimir Luna Cárdenas <offray.luna(a)mutabit.com> wrote:
>>>>
>>>> Hi,
>>>>
>>>> I'm using STON for all my light storage serialization needs, like the
>>>> Grafoscopio notebooks, and I also love it, as Russ stated in their mail
>>>> question, and I share with him a similar request: for my Brea[1] static
>>>> site generator I would like to store some BreaQuery objects as external
>>>> STON files, and recover them, so I can run the queries that
>>>> recreate/update the website easily. I could store them as Grafoscopio
>>>> notebooks, but I don't want to make Grafoscopio a prerequisite for Brea
>>>> or I could use Fuel, but I would like to store queries as a diff
>>>> friendly text based format. I have considered Metacello/Iceberg packages
>>>> to export code in a diff friendly format, but It maybe overkill. So I
>>>> would like to see if STON can serve me here too.
>>>>
>>>> [1] https://mutabit.com/repos.fossil/brea/
>>>> [2] https://mutabit.com/repos.fossil/indieweb/
>>>>
>>>> So far, I'm able to serialize a code block as a string using:
>>>>
>>>> BreaQuery>>asStonModified
>>>> self codeBlock: self codeBlock asString
>>>> ^ STON toStringPretty: self
>>>>
>>>> But I'm unable to populate a block from a string. There is any way to
>>>> make a string, lets say 'a + b', to become the code contents of a block,
>>>> ie: [a + b ] ?
>>>>
>>>> Thanks,
>>>>
>>>> Offray
>>>>
>>
>> --------------------------------------------
>> Stéphane Ducasse
>> http://stephane.ducasse.free.fr / http://www.pharo.org
>> 03 59 35 87 52
>> Assistant: Aurore Dalle
>> FAX 03 59 57 78 50
>> TEL 03 59 35 86 16
>> S. Ducasse - Inria
>> 40, avenue Halley,
>> Parc Scientifique de la Haute Borne, Bât.A, Park Plaza
>> Villeneuve d'Ascq 59650
>> France
>>
>
> --------------------------------------------
> Stéphane Ducasse
> http://stephane.ducasse.free.fr / http://www.pharo.org
> 03 59 35 87 52
> Assistant: Aurore Dalle
> FAX 03 59 57 78 50
> TEL 03 59 35 86 16
> S. Ducasse - Inria
> 40, avenue Halley,
> Parc Scientifique de la Haute Borne, Bât.A, Park Plaza
> Villeneuve d'Ascq 59650
> France
>
Dec. 4, 2020