Imperative programming is a paradigm of expressing the logic of a computer program or computation by explicitly describing its control flow in terms of statements that change a program state.
Questions tagged [imperative]
57 questions
0
votes
2 answers
How do I scale values all the values in a list where the largest value is 1 and the smallest value is 0
I am trying to scale all the values in a list where the largest value is 1 and the smallest value is 0. Here is an example of what I am trying to accomplish
(check-expect (squash (list 100 90 70 20)) (list 1 0.875 0.625 0)).
As you can see the…

CanadianBeaver
- 87
- 10
0
votes
1 answer
Make manifest file from imperative command
I am reading on k8s it has 2 method to use it. Both of them are complement of each other.
Today I tried one feature to get a declarative (manifest file).
Suppose I create namespace instance
$ kubectl create namespace…

joe
- 8,383
- 13
- 61
- 109
0
votes
0 answers
Can pure imperative programming incorporate functions
As the question suggests, if a program should be written in a purely imperative style (even if the programming language is an amalgamated language like PHP or Python which support other paradigms like OOP), should the program incooperate built in…

Liam Fell
- 1,308
- 3
- 21
- 39
0
votes
0 answers
Assigning a struct member-array to another struct-array
I have to structs defined as:
typedef struct {
char weekday[WEEKDAY_SIZE],
start_time[START_TIME_SIZE],
home_team[TEAM_SIZE],
away_team[TEAM_SIZE],
spectators[SPECTATOR_SIZE];
int day, month, year, round,…

asdasd
- 59
- 6
0
votes
1 answer
What does it mean to convert a function to a table look up?
In this video titled Don't fear the monad, between 05:02 and 06:05, Brian Beckman says:
Every imperative programmer goes through this phase of learning that
functions can be replaced with table look-ups. Often, you do this for
performance. You…

Water Cooler v2
- 32,724
- 54
- 166
- 336
0
votes
2 answers
How to show percent done in terminal
Good day all.
Today i'm working in this complex script that makes request's to a site with server-side rendering, get's the HTML, breaks and grabs some data. The script has 4 phases: phaseOne, phaseTwo, phaseThree and phaseFour.
Which phases has a…
user3998237
0
votes
0 answers
Imperative access to database
I'm interested if anyone knows of a database server, which offers imperative access to the data (skipping query parsing, estimation) and providing the client something like "file" api access to the data?
Thanks

pevgeniev
- 389
- 2
- 13
0
votes
2 answers
Implementation of unlimited precision integers
Problem: "A big integer is represented as a list of (small) integers."
Suppose to have:
type reg = string;; (* "$0" models register set to constant 0 *)
type label = string;; (* empty string models no label *)
type asmistr =
AsmHalt
| AsmNop
…

genesisxyz
- 778
- 3
- 14
- 29
0
votes
3 answers
Need ideas to transform F# imperative code to functional
I have a function witch is written in an imperative style and cant get my head around on how to convert it to a more robust functional approach.
The function takes a seq of strings and returns a seq of tuples where each tuple consists of the…

Alex
- 2,710
- 1
- 24
- 26
-1
votes
2 answers
What are the differences between imperative and functional programming languages?
What is the definitive answer regarding the differences between imperative languages and functional (a sub-set of declarative) programming languages, and can it be explained with practical examples? What are some of the main or most important…

Marcelo
- 21
- 1
-1
votes
3 answers
is it possible to write functional version for below imperative code in scala
I wrote sum code in scala to find the majority element(the element which appears more than n/2 times where 'n' is the no.of elements in an array.I want to know where there is functional / scala native style of version(which includes match cases and…

Mahesh
- 178
- 3
- 14
-4
votes
1 answer
functional code to below imperative one in scala
i want to write the functional version for finding the pair of elements with given sum.the below is the imperative code:
object ArrayUtil{
def findPairs(arr:Array[Int],sum:Int) ={
val MAX = 50
val binmap:Array[Boolean] = new…

Mahesh
- 178
- 3
- 14