[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

minor patches, random questions.




The diff file is at http://web.nilpotent.org/tmp/goo-2003-11-26.txt

c/grt.c: (app-args) was returning the args in reverse order.

emacs/goo.el: I noticed that my code using (with-port ...) indented
differently from the code in goo's sources.
  
src/goo/top.goo, src/goo/main.goo: This code lets you run goo scripts.
You can create a file with

== cut here ==
#!/path/to/goo --

(+ 2 3)
== cut here ==

make it executable, and run it.

There are two problems with this.  The first one is that the first two
elements of (app-args) are now "--" and the name of the script you're
running.  Since scripts generally expect argv[1] and upwards to point
to real arguments, argc/argv need to be mangled to skip these two args.
Will a simple { Pargc += 2; Pargv += 2; } in read-script work?

Other problem: the changes to main.goo.  They're not nice, but that's
because i tried to keep the ";;; GOO\n;;; JONATHAN BACHRACH\n ..." 
header when goo was started interactively.


I thought about writing a file-access method --

(file-access 'read "/etc/passwd") => #t
(file-access 'write "/etc/shadow") => #f
(file-access 'execute "/bin/ls") => #t

but I realized that instead of hacking src/goo/%system.c, I could
simply write inline C code using the access(2) system call.  Which
cases call for inline C and which cases call for %fns?

Also -- I couldn't figure out how to build and return a tuple from C.


Thanks,

Faried.