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

Re: read



> 	+ don't strip the trailing newline

i'd stick to stripping the delimiter. otherwise, you're heading into perl
territory.

> 	+ let %read take a prompt argument, ala %parse
> 	+ use readline/editline if appropriate

i guess so. although i'm not a fan of either, the world in general would
probably want this.

> 	+ don't hardcode the line delimiter as \n

definitely a good idea.

> 	+ not including any such builtin and dropping the idea entirely

well, i dunno. read's been a religious issue with me (and rog) since rc 1.2,
but that's because it's merely the best example of a more general problem -
that of getting the status of a backquote command. i can understand the
desire for a read builtin (one less fork/exec, and it compliments a builtin
echo), but i'd hate the opportunity of fixing <=+` to go by. $&backquote
putting status in the first element seems like the best way so far. i'd
suggest adding an extra arg to $&backquote:

  $&backquote statusvar separators cmd args

but of course that doesn't work with es's scoping rules either :-(.

steve.