Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Short-Circuiting with Logical Operators
Message
De
28/10/2014 17:13:00
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
28/10/2014 11:37:25
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Allemagne
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows Server 2003
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01609995
Message ID:
01610053
Vues:
35
>>Lutz, while what you are saying is true, in Argentina we have a saying "Estás meando fuera del tarro" ("“You are peeing outside the jar/can”) as it has nothing to do with the thread, which is about short circuiting logical operators, nothing to do with the differences between procedure and function or parameter changing (there are no changes in the parameters in the example), that is what is startling Gregory.
>
>Not realy
>
>If it is important that a function returns or changes something different then its value then it's a non good design.
>IOW. If a function just does what is is made for (return a value depending on it's input) no harm can be done by shortcutting.
>
>So in the example in the OT the print of something is simple a sideefect a functiion is (general speaking) not made for.

OK, but OTOH nothing should break the usual way the shortcircuiting works. For example, this is intentional:

if used("myalias") or MyFunctionToOpen("myalias")


... should have the result that myAlias is in use or we have a major error - nothing else. I.e. the function should never be called if myalias is already open. Anything that would break these rules would be voted out by about 99% majority of programmers. Don't change the foundation rules, period.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform