[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Aw: Re: Inline `ifdef style` debugging
From: |
pjodrr |
Subject: |
Aw: Re: Inline `ifdef style` debugging |
Date: |
Thu, 11 Aug 2011 00:23:00 -0700 (PDT) |
User-agent: |
G2/1.0 |
Hello,
Am Montag, 8. August 2011 19:20:25 UTC+2 schrieb Steven W. Orr:
>
> if (( debug ))
> then
> _debug()
> {
> "$@"
> # I do question whether this is a viable construct, versus
> # eval "$@"
> }
> else
> _debug()
> {
> :
> }
> fi
>
on bash-hackers.org I found this, which I think is the ultimate
method to write a debug-function:
_debug() {
if $whatever_test_you_prefer; then
_debug() {
"$@"
}
else
_debug() {
:
}
fi
_debug "$@"
}
they call it "collapsing functions":
http://wiki.bash-hackers.org/howto/collapsing_functions
have fun,
Peter
- Inline `ifdef style` debugging, Roger, 2011/08/08
- Re: Inline `ifdef style` debugging, Andreas Schwab, 2011/08/08
- Re: Inline `ifdef style` debugging, Dennis Williamson, 2011/08/08
- Re: Inline `ifdef style` debugging, Roger, 2011/08/08
- Re: Inline `ifdef style` debugging, Steven W. Orr, 2011/08/08
- Re: Inline `ifdef style` debugging, Roger, 2011/08/08
- Who's the target? Was: Inline `ifdef style` debugging, Steven W. Orr, 2011/08/08
- Re: Who's the target? Was: Inline `ifdef style` debugging, Roger, 2011/08/08
- Re: Who's the target? Was: Inline `ifdef style` debugging, Roger, 2011/08/09
- Message not available
- Aw: Re: Inline `ifdef style` debugging,
pjodrr <=
- Re: Re: Inline `ifdef style` debugging, Roger, 2011/08/11
- Re: Re: Inline `ifdef style` debugging, Greg Wooledge, 2011/08/11
- Re: Re: Inline `ifdef style` debugging, Roger, 2011/08/11
- Re: Re: Inline `ifdef style` debugging, Greg Wooledge, 2011/08/11
- Message not available
- Aw: Re: Re: Inline `ifdef style` debugging, pjodrr, 2011/08/11
- Message not available
- Aw: Re: Re: Inline `ifdef style` debugging, pjodrr, 2011/08/11