pathnames [Re: files, printers, etc. [Re: The feel of a Lisp

Alaric B. Williams alaric@abwillms.demon.co.uk
Thu, 8 May 1997 18:11:22 +0000


> >You could write:
> >
> >(*employees* 'pictures #(picture of Lionel))
> >(*employees* 'names "Lionel B. Snell")
> >(*employees* 'surname "Snell"
> >
> >The directory objects "pictures", "names", and "surname" are all in
> >fact accessors for one database-like object.
 
> So what's the deal with this very un-lispish syntax? Why not do things
> the way it's always been done...
> 
> (search-by-picture *employees* #(picture of Lionel))
> (search-by-name *employees* "Lionel B. Snell")
> (search-by-surname *employees "Snell")
> 
> ;;people older than 50
> ((lambda (list) (mapcar list (lambda (item) (- (date) (birthday item)) < 50)))
> 		*employees*)

Those are source code. My syntax is designed as what the user types in - 
it's in a linear format, with specificity increasing to the right, that's
common amongst humans, and is familiar from:

http://www.ibm.com/blah/blah/blah/
/bin/ls
MyPtr->FieldPtr->Field
struct.struct_field.field

to name but a few :-)

Now, I feel that the user-level object system is there purely to aid
the user in choosing an object. Indeed, if an application wants all
employees above 50, it would access the directory object of employees
directly and ask it as you have written. But the pathparser would be
used to convert the user's typings or selecting-from-list-boxes into
a reference.

> >I don't explain myself too well, I'm afraid. The . is the idenitifier of
> >a variable, yes; just in line with the UNIXy convention, this particular
> >person has called his PWD "."!
 
> Then I don't follow why the "." is in between "()" as if "." was the
> name of a function.

I abandoned that syntax. Now, I'd write:

(*cwd* 'file 'file)

using normal quoting for literal symbols, and taking all other symbols
as binding references to things like CWDs. 

*.* may become a popular name for a CWD, except it looks like a DOS
wildcard :-)
  
> >> >(make-path *internet* "abwillms.demon.co.uk" 'Public 'Hello!)
> >> 
> >> You're still assuming simple tree structure with a single key for
> >> getting at your objects.
> >
> >But no :-)
 
> I can't see how. What exactly is the symbols 'Public and 'Hello
> supposed to be then?

They are just one path to the object. Since we're just using symbols
to access things, I'm assuming that we're using an underlying filer
architecture that just binds symbolic names to stuff. 'Public 'Hello!
may be one path to the object containing my text used to greet new friends,
but "'Private 'Work-in-progress 'Publications 'NewUserHello" may be another.


ABW
--
Alaric B. Williams (alaric@abwillms.demon.co.uk)

   ---<## OpenDOS FAQ ##>---

Plain HTML: http://www.delorie.com/opendos/faq/
            http://www.deltasoft.com/faq.html

Fancy HTML: http://www.deltasoft.com/faq0000.html