side-effects Questions
4
Solved
I want to generate unique numbers for each class in my header, primes in my case primes but let's say this should only be consecutive numbers i.e. 1,2,3,4,etc.
Of course I can hardcode these:
str...
Nonmoral asked 30/3, 2012 at 19:46
1
Solved
I know one of the goals of pure functional programming is to eliminate mutability, and therefore to preclude side-effects. But let's face it, Java is not a functional language even with all of the ...
Caren asked 1/3, 2012 at 23:41
2
Solved
Oracle's documentation on atomic access (at http://docs.oracle.com/javase/tutorial/essential/concurrency/atomic.html) says this:
"a volatile variable establishes a happens-before relationship......
Upturned asked 7/2, 2012 at 0:10
3
Solved
Most common pattern for using a database in a functional language, given desire for no side-effects?
I'm trying to get my head around a core concept of functional langauges:
"A central concept in functional languages is that the result of a function is determined by its input, and only by its inp...
Horripilation asked 6/12, 2011 at 20:18
6
Solved
putStrLn when called with any arguments will always return a value of type IO (). I agree that's pure, I can handle that. But is it referentially transparent? I think so, because for any given inpu...
Hakodate asked 5/12, 2011 at 8:7
2
Solved
Sorry for opening this topic again, but thinking about this topic itself has started giving me an Undefined Behavior. Want to move into the zone of well-defined behavior.
Given
int i = 0;
int v[1...
Cranmer asked 4/10, 2010 at 4:6
2
Solved
For a homework assignment, we've been instructed to complete a task without introducing any "side-effects". I've looked up "side-effects" on Wikipedia, and though I get that in theory it means "mod...
Ligation asked 28/9, 2011 at 5:34
3
Solved
Imagine an imperative rendering engine that blits sprites to a bitmap that later gets displayed. This heavily relies on the ability to efficiently mutate individual pixels in said bitmap. How would...
Kingdom asked 2/9, 2011 at 21:3
2
Solved
I'm wondering if it's possible for a closure in Python to manipulate variables in its namespace. You might call this side-effects because the state is being changed outside the closure itself. I'd ...
Preconceive asked 3/7, 2011 at 23:41
5
Solved
Consider the following line of code:
new (p++) T();
If the constructor T() throws an exception, is p guaranteed to have already been incremented?
Akkadian asked 27/6, 2011 at 17:56
6
Solved
I am trying to evolve my understanding of side effects and how they should be controlled and applied.
In the following List of flights, I want to set a property of each flight satisfying a conditi...
Drain asked 17/6, 2011 at 13:8
1
To my mind the power of functional purity is when deep code paths can be verified as side-effect free. What are people's experiences in the scale of the code tree that can be inside a pure specifie...
Rhatany asked 28/4, 2011 at 0:13
1
Solved
If I comment out the Dumper($cmd_string) then the while loop is never taken.
What side effects does Dumper() have on $cmd_string?
Here is what $cmd_string is before the sub call:
VAR1 = {
'The ...
Haymo asked 23/3, 2011 at 21:6
1
Solved
I'm working with csproj files using Powershell to perform large-scale editing of project references. So far I've managed to edit the Include attributes on ProjectReferences using the following line...
Walli asked 28/2, 2011 at 19:39
3
Solved
Can the C++ compiler assume a 'const bool &' value will not change?
For example, imagine that I have a class:
class test {
public:
test(const bool &state)
: _test(state) {
}
void doS...
Diplococcus asked 26/2, 2011 at 17:48
10
Solved
Any code can provide side effects. Most of the time, side effects can be a sign of bad design and/or need of refactorisation, but when unit testing I find it hard to test against. Consider the foll...
Osmo asked 30/7, 2010 at 12:24
7
Solved
I just got my copy of Expert F# 2.0 and came across this statement, which somewhat surprised me:
For example, when necessary, you can
use side effects on private data
structures allocated at t...
Goad asked 13/9, 2010 at 3:53
5
Solved
In the context of functional programming, a typical example of a side effect is "launch the missiles". Where does that expression come from historically?
Pamphleteer asked 5/5, 2010 at 12:8
2
I'm using the code below to free up memory on some running programs because my own program needs large memory resources to run faster.
[DllImport("psapi.dll")]
public static extern bool EmptyWorki...
Mg asked 28/11, 2009 at 8:52
4
Solved
I've been playing with functional programming lately and there are pretty good treatments on the topic of side effects, why they should be contained, etc. In projects where OOP is used, I'm looking...
Lanfranc asked 27/7, 2009 at 13:43
9
Solved
I'm working on a project on an 8051 where every byte counts. As such, I am using some global variables where I normally wouldn't. The normal method of passing pointers into a function adds too much...
Ramsdell asked 13/4, 2009 at 21:59
4
So I'm currently working on a new programming language. Inspired by ideas from concurrent programming and Haskell, one of the primary goals of the language is management of side effects. More or le...
Habitude asked 29/4, 2009 at 16:21
3
Solved
I'm learning functional programming, and have tried to solve a couple problems in a functional style. One thing I experienced, while dividing up my problem into functions, was it seemed I had two o...
Moro asked 22/11, 2008 at 6:40
© 2022 - 2024 — McMap. All rights reserved.