Apart from the things I mentioned to you on discord (fileout through
FileWriter, etc)... another idea came into my mind that could be possibly
interesting.

Every time a thing (Class, Method, ...) is created/changed/deleted, an
event is announced in the system that you can watch for. (e.g. Nautilus
uses this so when you add a method in one window, all Nautilus windows are
updated).

And then you do an immediate fileout of the changed item to the disk.

a (hopefully still working) example:

```
ReflectiveWriter compile: 'methodChanged: aMethodAnnouncement
| method dir |
method := aMethodAnnouncement method.
dir := FileLocator temp / ''outside-code'' / method methodClass name.
dir ensureCreateDirectory.
(dir / method selector)
ensureDelete;
writeStreamDo: [ :stream |
"because line endings are #cr-azy by default"
stream wantsLineEndConversion: true.
stream << method sourceCode ]'.
```

I don't know how can Pharo watch for file changes in the system, but the
opposite is also be doable in some manner.

(and of course you could filter to write changes only when the change is in
particular class, or particular package, or whatever).

You would have to implement it yourself (extra time of coding, testing,
debugging, ...), but in principle it should be doable within reasonable
effort.

Peter

On Fri, Aug 25, 2017 at 4:14 PM, Luke Gorrie <l...@snabb.co> wrote:

> On 20 August 2017 at 12:50, stephan <step...@stack.nl> wrote:
>
>> I'm afraid you might do newbies a disservice by adding yet another way of
>> loading and saving combinations of packages.
>
>
> I have been reflecting on this point a bit. I think there are two relevant
> classes of newbies here.
>
> One is people who are learning to be Pharo hackers and joining this
> community. They need to "get with the program" and learn to do things the
> same way as everybody else. So they need to learn Smalltalk, Monticello,
> Metacello, Iceberg, FogBugz, etc.
>
> The other is people who are using a Pharo-based application and want to
> make an extension. For example, imagine a Dr. Geo user who wants to
> contribute support for a new geometric function that they need for their
> work. This person needs to take the shortest path to solving their problem:
> reuse their existing skills (e.g. command-line git) and make use of
> examples (e.g. copy-paste-tweak some existing code.)
>
> I'm concerned about the latter group. I'm building an application that I
> want users to be able to extend, and I am assuming that most of them are
> not aspiring Smalltalk hackers (yet.) So I am wondering how to minimize the
> barriers to entry for people to contribute their first extension.
>
> My model is Emacs. Lots of people use Emacs to edit text files. Many of
> them become power users by copy-paste-tweak from each others' configuration
> files. Only a few take the next step and learn Lisp e.g. to understand what
> "lambda" actually means. Everybody manages to participate and share.
>
> So, coming back to point, this is why I imagine now is to have a simple
> "Save all..." item in the World menu that saves all of the
> relevant-to-this-application packages back into a directory on the local
> disk (which will be a Git checkout that can be committed, pushed, and Pull
> Requested.) Then I don't need to force people to learn Metacello, etc, just
> to become "power users" of the application.
>
> Maybe I am still on the wrong track anyway? Maybe others have been down
> this specific trail before, too?
>
>
>

Reply via email to