Re: Various issues
Bram Moolenaar <[email protected]>
| Newsgroups | gmane.comp.tools.aap.devel |
|---|---|
| Message-ID | <[email protected]> |
Adriaan de Groot wrote:
> [i don't normally send bunched-up mail, but i'm on vacation and typing on
> a danish keyboard, which messes with my brain.]
The temperature here also causes problems (up to 38 degrees
yesterday...).
> * The table 2.1 in the tutorial, "Special characters in the "print"
> command", seems to be out of place. Or at least, it should be repeated in
> the reference manual either under :print or in the list of variables.
This used to be a table of specific names, which is why I placed it
in the tutuorial. But now that everything is done with the $(x) form
it's easy to just mention it briefly. I'll move the table to the first
chapter of the user manual, just after where the user of variable names
is explained.
> * Adding line breaks a-la python in AAP :commands isn't possible due to
> syntactic ambiguity. What would
>
> :route a b
> c d
> e
> f g h
>
> mean? Adding a colon in there somewhere would help.
I don't understand your remark. It's true that in some commands a line
break is explicitly used to separate parts of the command. But you can
always use a backslash at the end of the line for continuation, or
(preferred) give a line more indent to have it joined with the previous
one. Thus this works the same as the above:
:route a \
b
c d
e
f g
h
> * Actions that create temporary files, like
>
> :action turn B A
> @tempfile=sufreplace("",".bla",source)
> :sys foo $source > $tempfile
> :sys bar $tempfile > $target
> :sys rm -f $tempfile
>
> have a cleanup problem - what if foo fails? or bar? worse still, $target
> might be created and empty but newer-dated by the shell redirection, even
> if bar fails. It'd be nice to have a cleanup attribute or an exception
> mechanism in actions to be able to do such cleanup (maybe all it needs is
> documenting)
You can use the Python try/except/finally mechanism. There are a few
examples for this, e.g., at the end of the "Using Python" chapter in the
user manual. But perhaps such an example should be added in the chapter
about actions? Not in the tutorial though, it's too advanced.
If the commands fail then $target is still outdated, it doesn't matter
if the file was created or not.
> * :do something $source { filetype=h } sets the source name to
> $source{filetype=h} - not what you would expect. And sufreplace() on such
> a broken filename leaves the trailing } in place.
Well, if you give attributes to the source file(s), they end up in the
value of $source. That's what you specified. You can use $-source to
get rid of the attributes. An alternative would be to remove the
attribute from $source and put it on the node, but you probably wanted
this filetype to be used only when invoking the action, not as _the_
filetype for this source.
That a trailing } is left behind is a bug in sufreplace(). Another bug
in that function in a short time. I think I'll have to change it into
something more clever than just using a string replacement on the whole
argument.
> * stuff in my pipeline:
> - large updates to the tutorial,
Very welcome.
> - adding support for dir supportin :child so you can say :child
> dirname and have AAP read that as :child dirname/main.aap
I suppose you see this as a way to specify sub-projects by the name of
the directory. Is leaving out "/main.aap" enough advantage to add code
for this and let the casual user guess that "/main.aap" is automatically
appended?
> - adding support for multiple children, so you can say :child dir1
> dir2 dir3
Why not use separate commands?
--
hundred-and-one symptoms of being an internet addict:
90. Instead of calling you to dinner, your spouse sends e-mail.
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\
\\\ Project leader for A-A-P -- http://www.A-A-P.org ///
\\\ Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html ///
-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01