side-effects Questions

7

Solved

Is there any way to prevent side effects in python? For example, the following function has a side effect, is there any keyword or any other way to have the python complain about it? def func_with...
Hyperform asked 13/12, 2013 at 14:42

3

Solved

So I'm trying to learn FP and I'm trying to get my head around referential transparency and side effects. I have learned that making all effects explicit in the type system is the only way to gua...

1

Solved

Is there a standard or best practice for writing javadocs for Java/JVM language methods which contain side effects? I have a void method defined, which modifies one of the method parameters, but d...
Fidler asked 5/4, 2016 at 0:25

4

Solved

I am in trouble with ocaml. I want to make a function that will increment my counter every time I call it and concat my vargen string with the counter number and return this new string. What I di...
Deacon asked 5/5, 2012 at 6:10

3

Solved

I came across a statement in the text C How to Program: "Expressions with side effects (i.e., variable values are modified) should not be passed to a macro because macro arguments may be evaluated...
Hyperion asked 29/8, 2015 at 8:22

1

Solved

I know that sizeof never evaluates its operand, except in the specific case where said operand is a VLA. Or, I thought I knew. void g(int n) { printf("g(%d)\n", n); } int main(void) { int i = 1...
Polyphemus asked 24/6, 2015 at 12:57

3

Let's say you're writing a function to check if a page was reached by the appropriate URL. The page has a "canonical" stub - for example, while a page could be reached at stackoverflow.com/question...

3

Solved

I have read in C++ : The Complete Reference book the following Even though objects are passed to functions by means of the normal call-by-value parameter passing mechanism, which, in theory, pr...
Pontic asked 14/10, 2011 at 4:20

3

In Scala collections, if one wants to iterate over a collection (without returning results, i.e. doing a side effect on every element of collection), it can be done either with final def foreach(f...
Palliative asked 10/9, 2014 at 0:0

3

Solved

I'm dabbling in functional languages and I have found some algorithms (especially those that use dynamic programming) harder to write and sometimes less efficient in worst case runtime. Is there a ...

3

Solved

As I always understood it, any change to the programs state (or anything to do with IO) is a side effect. It does not matter, whether the change occurs in a global variable or in a private field of...
Wilkinson asked 1/5, 2009 at 5:27

7

Solved

I commonly use del in my code to delete objects: >>> array = [4, 6, 7, 'hello', 8] >>> del(array[array.index('hello')]) >>> array [4, 6, 7, 8] >>> But I have...
Blaspheme asked 28/4, 2014 at 2:3

2

Solved

I just started to explore the language Kotlin. I'm struggling with inheritance, var&val and side-effects. If I declare a trait A with a val x and override x in AImpl it is possible to override...
Antihero asked 2/4, 2014 at 18:54

1

Solved

I have the following code (RAD Studio XE2, Windows 7 x64): program letters; {$APPTYPE CONSOLE} {$DEFINE BOO} const ENGLISH_ALPHABET = 'abcdefghijklmnopqrstuvwxyz'; begin {$IFDEF BOO} writeln...
Sondrasone asked 9/3, 2014 at 19:13

3

Solved

In his answer's comment section, Apocalisp states the following: Well, you did ask for a function. A side-effenting [sic] lexical closure is emphatically not a function. What exactly does he ...

1

Solved

Are there any existing tools for side effects/purity analysis in Python, similar to http://jppa.sourceforge.net in Java?
Dowson asked 30/12, 2013 at 13:15

1

Solved

Accordint to this quite highly upvoted answer, the canonical way to iterate through a set erasing some elements is the following: for (it = mySet.begin(); it != mySet.end(); ) { if (conditionToDe...
Aldon asked 23/10, 2013 at 15:35

2

Solved

I am considering moving from Matlab to Python/numpy for data analysis and numerical simulations. I have used Matlab (and SML-NJ) for years, and am very comfortable in the functional environment wit...
Assent asked 9/3, 2010 at 18:19

4

Solved

I'm feeling rather silly asking this question, but it's been on my mind for a while and I can't find any answers. So the question is: why can applicative functors have side effects, but functors c...
Dickson asked 29/1, 2013 at 5:56

1

Solved

I have a question Regarding PHP Basic Coding Standards PSR1. PSR 1 Rule 2.3 states: Rule 2.3 Side Effects A file SHOULD declare new symbols (classes, functions, constants, etc.) and cause no...
Polled asked 8/11, 2012 at 22:16

1

Solved

C++03 Standard 1.9/6 defines observable behavior: The observable behavior of the abstract machine is its sequence of reads and writes to volatile data and calls to library I/O functions. and t...
Clementeclementi asked 7/11, 2012 at 14:11

2

Solved

Can (or should) a macro expansion have side effects? For example, here is a macro which actually goes and grabs the contents of a webpage at compile time: #lang racket (require (for-syntax net/ur...
Martinamartindale asked 26/10, 2012 at 5:37

1

When I today read the C Standard, it says about side effects Accessing a volatile object, modifying an object, modifying a file, or calling a function that does any of those operations are all ...
Evilminded asked 14/10, 2012 at 10:17

2

Solved

I am learning Scala right in these days. I have a slight familiarity with Haskell, although I cannot claim to know it well. Parenthetical remark for those who are not familiar with Haskell One tr...

2

Solved

No previous questions about it, so here I ask. Background: I have an old app, in free and paid versions, in the Play Market. I created a new version, radically changed and with a different paymen...
Borges asked 4/4, 2012 at 4:59

© 2022 - 2024 — McMap. All rights reserved.