imperative-programming

Idiomatic clojure for progress reporting?

风格不统一 提交于 2019-11-27 10:00:40
问题 How should I monitor the progress of a mapped function in clojure? When processing records in an imperative language I often print a message every so often to indicate how far things have gone, e.g. reporting every 1000 records. Essentially this is counting loop repetitions. I was wondering what approaches I could take to this in clojure where I am mapping a function over my sequence of records. In this case printing the message (and even keeping count of the progress) seem to be essentially

Why is Haskell (sometimes) referred to as “Best Imperative Language”?

跟風遠走 提交于 2019-11-27 06:07:24
(I hope this question is on-topic -- I tried searching for an answer but didn't find a definitive answer. If this happens to be off-topic or already answered, please moderate/remove it.) I remember having heard/read the half-joking comment about Haskell being the best imperative language a few times, which of course sounds weird as Haskell is usually best known for its functional features. So my question is, what qualities/features (if any) of Haskell give reason to justify Haskell being deemed the best imperative language -- or is it actually more of a joke? luqui I consider it a half-truth.

What is the difference between declarative and imperative programming? [closed]

放肆的年华 提交于 2019-11-26 15:34:15
I have been searching the web looking for a definition for declarative and imperative programming that would shed some light for me. However, the language used at some of the resources that I have found is daunting - for instance at Wikipedia . Does anyone have a real-world example that they could show me that might bring some perspective to this subject (perhaps in C#)? A great C# example of declarative vs. imperative programming is LINQ. With imperative programming, you tell the compiler what you want to happen, step by step. For example, let's start with this collection, and choose the odd

Why is Haskell (sometimes) referred to as “Best Imperative Language”?

夙愿已清 提交于 2019-11-26 11:52:17
问题 (I hope this question is on-topic -- I tried searching for an answer but didn\'t find a definitive answer. If this happens to be off-topic or already answered, please moderate/remove it.) I remember having heard/read the half-joking comment about Haskell being the best imperative language a few times, which of course sounds weird as Haskell is usually best known for its functional features. So my question is, what qualities/features (if any) of Haskell give reason to justify Haskell being

What is the difference between declarative and imperative programming? [closed]

随声附和 提交于 2019-11-26 03:46:39
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 2 years ago . I have been searching the web looking for a definition for declarative and imperative programming that would shed some light for me. However, the language used at some of the resources that I have found is daunting - for instance at Wikipedia. Does anyone have a real-world example