proposed WebDAV mapping

So I’ve got a class called “Spoon” which services requests about Spoon from the rest of the world, via WebDAV. In particular, I provide the illusion of a filesystem that can be mounted by other operating systems. Editing certain of those virtual files invokes behavior within Spoon.

Here’s a summary of that filesystem:

    (frequently-used expressions, presented as executable files)
    (all the classes)
      (a file for each method of <class>)   
  /do (a file to which one write a method, which is
           then executed, leaving the result as the
           file contents)
  /notes/ (a normal directory, for use as a staging
           area for "do" files, for example)

Here’s what you might see at a shell on a machine which has a mounted Spoon system:

craig@netjam spoon> pwd
craig@netjam spoon> ls
classes/  notes/  do
craig@netjam spoon> cd classes
craig@netjam classes> ls
craig@netjam classes> cd Object
craig@netjam Object> ls
Boolean/  Collection/  (etc.)
craig@netjam Object> cd Boolean
craig@netjam Boolean> ls
and:  ifFalse:  ifTrue:  (etc.)
craig@netjam Boolean> more ifTrue:
ifTrue: aBlockClosure
  "If I am true, answer the value of aBlockClosure. Otherwise, answer nil."

  self subclassResponsibility Boolean> cd /Volumes/spoon spoon> echo "3 + 4" >! do spoon> more do
7 spoon> cd /bin bin> ls
snapshot  (etc.) bin> snapshot

This seems like the minimal functionality. What else would be nice or fun to have?

10 Responses to “proposed WebDAV mapping”

  1. /bin/senders /Classes/Object/printOn:
    /bin/implementors /Classes/Object/printOn:
    /bin/references /Classes/Object
    rm –safely someMethod

    # next line: refactoring browser’s push method up
    mv printOn: ..


  2. Hi Craig,

    that looks like a very interesting idea. I have just a small concern about this do file. Why would you replace the file content by the result instead of putting the result in a /result file? That might no be a problem, but it looks suspicious.

    Is it possible to pass parameters to the executables in /bin?

    If you introduce packages/categories in Spoon, it might be worth reflecting this in a new entry point (e.g., /packages/collections/arrayed/Array). Same thing for protocols (e.g., /…/aClass.protocols/accessing).

    Do you also plan to access/modify objects in this filesystem?

    Going a bit further, do you think it could be possible to implement a Smalltalk application by only using Bash syntax?


    • Craig Latta Says:

      Yeah, a /result file makes sense.

      Sure, one could pass parameters to the bin executables. I like Bob’s example above.

      Oh yes, there are a lot of things to be done with Naiad modules and module/class/method/author tags.

      I’d like to be able to manipulate individual objects as well, but I’m not sure how yet. I think being able to write a Smalltalk application as a shell script would be fun, in a twisted way. :)


  3. Not sure how the /bin directory would work. Reading a file from there would execute it? Because this is a regular shell, right? The filesystem would only see the read request. So no arguments. Unless you cleverly return an actual executable that somehow works on that platform and does something incredibly clever? IMHO this looks like taking the idea too far ;)


    • Craig Latta Says:

      Oh, good point. I guess every command could be a directory instead of a file, and you could write the arguments into a special file in the directory (it could even be a form you fill out). Clunky, but it could work.


      • I think it would be a good idea to learn from Linux’s /proc interface. This is how you interact with the kernel through a files system, writing into and reading from what looks like files. The files are created by the system.

        OTOH I am not sure you actually need more than the “do” mechanism, it can execute any message, right?

        echo 3 + 4 > do ; cat do
        echo Smalltalk snapshot > do

        For more fancy interaction you could have a web browser interface.

        Or for geek cred, a telnet interface.


  4. Instead of replacing the contents of a special file name, why not use STDIN/STDOUT? spoon> echo “3 + 4” | bin/doIt spoon> echo “3 + 4” | bin/printIt


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: