Gentoo Logo
Gentoo Spaceship

Installation:
Gentoo Handbook
Installation Docs

Documentation:
Home
Listing
About Gentoo
Philosophy
Social Contract

Resources:
Bug Tracker
Developer List
Discussion Forums
Gentoo BitTorrents
Gentoo Linux Enhancement Proposals
IRC Channels
Mailing Lists
Mirrors
Name and Logo Guidelines
Online Package Database
Security Announcements
Staffing Needs
Supporting Vendors
View our CVS

Graphics:
Logos and themes
Icons
ScreenShots

Miscellaneous Resources:
Gentoo Linux Store
Gentoo-hosted projects
IBM dW/Intel article archive




List Archive: gentoo-dev
Navigation:
Lists: gentoo-dev: < Prev By Thread Next > < Prev By Date Next >
Headers:
To: gentoo-dev@g.o
From: Alec Warner <antarus@g.o>
Subject: Re: Small review on function return codes and simplicity
Date: Tue, 31 Mar 2009 11:29:30 -0700
On Tue, Mar 31, 2009 at 11:05 AM, Donnie Berkholz <dberkholz@g.o> wrote:
> I noticed some eclass commits using java-pkg_func-exists() and it's a
> lot more complicated than it needs to me. Perhaps not everybody knows
> that bash generally gives a return status from functions of the last
> command run in that function. So these two things are equivalent:

Also worst feature ever, Ruby does it too and it sucks :)

>
> java-pkg_func-exists() {
>    if [[ -n "$(declare -f ${1})" ]]; then
>        return 0
>    else
>        return 1
>    fi
> }
>
>
> java-pkg_func-exists() {
>    [[ -n "$(declare -f ${1})" ]]
> }
>
>
> --
> Thanks,
> Donnie
>
> Donnie Berkholz
> Developer, Gentoo Linux
> Blog: http://dberkholz.wordpress.com
>


References:
Small review on function return codes and simplicity
-- Donnie Berkholz
Navigation:
Lists: gentoo-dev: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
Re: Small review on function return codes and simplicity
Next by thread:
Last rites: app-text/tetex
Previous by date:
Re: Small review on function return codes and simplicity
Next by date:
Re: RFC: EAPI cheat sheet for your desktop


Updated Jun 17, 2009

Donate to support our development efforts.

Gentoo Centric Hosting: vr.org

VR Hosted

Tek Alchemy

Tek Alchemy

SevenL.net

SevenL.net

php|architect

php|architect

Copyright 2001-2007 Gentoo Foundation, Inc. Questions, Comments? Email www@gentoo.org.