From: Paolo <oo...@us...> - 2006-12-19 13:51:27
|
On Mon, Dec 18, 2006 at 11:40:47PM -0500, Bill Y wrote: > > - [x] means *usually* 'take from-' entity 'x' > - (x) means *usually* 'write into-' entity 'x' ... > Yep. That occurred to me. But then you end up with the wierdness of > the var-restriction syntax washing over into () from [] > (as in, "open file /etc/foo, lseek to byte 10843, and write six bytes") > > How *would* you want to put it? Note that (stderr 10843 6) is > way not supported... it would be a file named "stderr\ 10843\ 6" > which is probably not what we want. well, since we already have [:x: seek|skip len] where supported, I see nop to have also (:x: seek|skip len) where supported. Which means to make 'seek|skip len' illegal or just ignored for specials stdout|stderr. > On the other other hand, (x) (y) (z) in SYSCALL means (from) (to) (status), which is perhaps the grosser violation > SYSCALL [var_restriction_string] (:result: :status:) /command/ that sounds +consistent to me: like in MATCH (:z: :x: :y:); keep safe the [:src:] (:sink:) rule 1st, then the actual COMMAND rules what you can put into [] (). > which would allow var restrictions in the syscall send, but require > that you ISOLATEd a temporary if you needed to "build" the string > out of pieces. I don't see the reason|need for that: possible rules for ?:filename: offset len?: where applicable, IF var_restriction_string :: existent var name THEN (use it as is OR do recursive expansion) AND perhaps retstart from top ELSEIF context doesn't allow for ":filename: offset len" THEN use it as it is (plain string) ELSEIF there are 2 ' ' AND offset, len expand to int THEN likely we have "file|var-name + offset + len" try to var-expand file|var-name get final string IF such 'final string' is an existent varname THEN either - it's content is the filename to work on - it's content is the string to work on | destination of write to ELSE use such "final string" as 'filename' for either (filename ... ...) to write to or [filename ... ...] to read from. In latter case either - complain if there's no such 'filename' - use such 'filename' as plain input string, apply offset+len on it - just use the whole final string "filename ... ..." as plain input string ELSE use the whole "file|var-name offset len" suitably wholly var-expanded as [literal input string] or (literal output filename) where makes sense. Issue an error only iff the result isn't applicable to the context. how does it looks like? -- paolo |