comp.lang.ada
 help / color / mirror / Atom feed
From: Ole-Hjalmar Kristensen <ole-hjalmar.kristensen@substitute_employer_here.com>
Subject: Re: Naming convention to identify functions with side effects
Date: 02 Oct 2008 14:33:32 +0200
Date: 2008-10-02T14:33:32+02:00	[thread overview]
Message-ID: <wvbrtzbvgorn.fsf@sun.com> (raw)
In-Reply-To: 48e13f14$0$6610$9b4e6d93@newsspool3.arcor-online.net

How would you implement the lock in youre case? I prefer not to mess
around with semaphores, but use protected objects instead. In that
case keeping the lock across the two calls is not so trivial.

>>>>> "GB" == Georg Bauhaus <see.reply.to@maps.futureapps.de> writes:

<snip>

    GB> Some issues become more obvious in a concurrent setting
    GB> perhaps,

    GB>    Web_Page.Load ("http://www.irvine.com");

    GB>    if Web_Page.Is_Loaded then...

    GB> There needs to be a lock of some sort joining the two calls.
    GB> Otherwise, the Web_Page object might have changed
    GB> between the two calls, a logic error.
    GB> Again, it might be tempting to pack the two calls in just
    GB> one in order to hide the locking mechanism, to give the
    GB> illusion of atomicity. But shouldn't normal Ada
    GB> concurrency features be employed instead?

    GB> If concurrency features of Ada are used instead, the
    GB> naming problem is also gone:
    GB> the commands (procedures) can be verbs and the queries
    GB> (predicate functions) can be named "Is_Something" or
    GB> "Has_Something".


-- 
   C++: The power, elegance and simplicity of a hand grenade.



  parent reply	other threads:[~2008-10-02 12:33 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-29 18:17 Naming convention to identify functions with side effects Hibou57 (Yannick Duchêne)
2008-09-29 18:45 ` Hibou57 (Yannick Duchêne)
2008-09-29 18:55 ` Adam Beneschan
2008-09-29 19:52   ` Dmitry A. Kazakov
2008-09-29 20:48     ` Georg Bauhaus
2008-09-29 21:10       ` Adam Beneschan
2008-09-30 15:17         ` Georg Bauhaus
2008-09-30 17:40           ` Ray Blaak
2008-10-02 12:33       ` Ole-Hjalmar Kristensen [this message]
2008-10-03  9:18         ` Georg Bauhaus
2008-10-06  7:24           ` Ole-Hjalmar Kristensen
2008-10-03 11:51       ` Brian Drummond
2008-10-03 12:28         ` Dmitry A. Kazakov
2008-10-04 12:30           ` Marco
2008-10-04 13:05             ` (see below)
2008-10-04 15:14               ` Gary Scott
2008-10-11 11:32               ` Marco
2008-10-11 14:57                 ` Dmitry A. Kazakov
2008-10-11 16:05                 ` (see below)
2008-10-11 17:49                   ` Georg Bauhaus
2008-10-11 18:42                     ` (see below)
2008-10-03 13:15         ` Jeffrey Creem
2008-09-29 20:57 ` Georg Bauhaus
2008-09-29 22:22 ` Dr. Adrian Wrigley
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox