Content deleted Content added
Scheme |
syntaxhighlight & fix lint |
||
(19 intermediate revisions by 14 users not shown) | |||
Line 1:
{{WikiProject banner shell|class=Start|
{{WikiProject Computing|importance=Low}}
{{WikiProject Computer science|importance=Mid}}
{{WikiProject Software|importance=Low}}
}}
{{Wikipedia Unreferenced articles improved|date=21 November 2014}}
== Disadvantages ==
Line 5 ⟶ 12:
== Common Lisp ==
The article lists Common Lisp as a strict programming language. I am under the impression that Common Lisp functions are strict, but Common Lisp macros are not. Do I understand correctly?
: As far as I can tell, macros are not directly related to strictness. Strictness relates to evaluation strategy, but macros are without evaluation strategy, as they are meta-evaluated. In effect, a macro can be used to change the evaluation strategy, so you can achieve macros that behave non-strictly.
:: I feel that this is worth a mention in the article. For example, ''Structure and Interpretation of Computer Programs'' in section 3.5 uses delayed evaluation via two macros (delay and force) in Scheme to implement data structures such as infinite lists (streams). Since this is actually practical and used in the Lisp family, this matter should be clarified in the article. [[Special:Contributions/132.236.75.84|132.236.75.84]] ([[User talk:132.236.75.84|talk]]) 15:28, 30 November 2009 (UTC)
::: Can't streams be implemented without macros in Scheme/Racket? <span style="font-size: smaller;" class="autosigned">— Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[Special:Contributions/77.101.47.254|77.101.47.254]] ([[User talk:77.101.47.254|talk]]) 12:10, 7 November 2013 (UTC)</span><!-- Template:Unsigned IP --> <!--Autosigned by SineBot-->
== Hardware optimized for strict languages? ==
Line 28 ⟶ 39:
::Consider the following example in typed lambda calculus, which takes a boolean and two functional thunks and returns another thunk:
<syntaxhighlight lang="text">
λ b : (unit -> a) -> (unit -> a) -> a. λ tr : unit -> a. λ fa : unit -> a. λ u : unit. b tr fa
</syntaxhighlight>
::In this case, b could be a suspended [[Church encoding]] of "true" or "false":
<syntaxhighlight lang="text">
true := λ tr : unit -> a. λ fa : unit -> a. tr ()
false := λ tr : unit -> a. λ fa : unit -> a. fa ()
</syntaxhighlight>
::So all you really need are functions and unit; non-strictness is just a matter of convenience if you don't want to deal with explicitly invoking your thunks. I won't claim it's not convenient, because it is; but it's not really a matter of expressiveness. --[[User:Donhalcon|bmills]] 19:26, 19 February 2006 (UTC)
Line 53 ⟶ 64:
I was under the impression that Scheme supports/can support some form of lazy evaluation...? -G3, 05:59, 13 December 2006 (UTC)
== C is not strict ==
True, in C, user-defined functions per se are strict, but the built-in operators <code>[[logical conjunction|&&]]</code>, <code>[[logical disjunction|||]]</code>, and <code>[[?:|?...:]]</code> all [[Short-circuit evaluation|short-circuit]], as does <code>[[Conditional (programming)|if...else]]</code>. Also true, a C++ that overloads these operators [http://stackoverflow.com/questions/5133114/overloading-logical-operators-considered-bad-practice loses the short-circuiting behavior]. But a [[C preprocessor]] macro can build a function that includes this short-circuiting behavior. Scheme also has <code>define-syntax</code> to build a function that short-circuits. --[[User:Damian Yerrick|Damian Yerrick]] ([[User talk:Damian Yerrick|talk]] | [[Special:Contributions/Damian Yerrick|stalk]]) 15:29, 7 May 2012 (UTC)
== Regarding Chess's game tree ==
Isn't it incorrect to call the game tree of chess finite, when at any point, the players can just keep going back and forth with a single piece? Wouldn't it be more correct to use a cyclic [[Directed graph]] for a finite representation?
== Difficult to understand ==
''A strict programming language is a programming language which employs a strict programming paradigm, allowing only strict functions''
What does that means? It's like a recursive definition <!-- Template:Unsigned IP --><small class="autosigned">— Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[Special:Contributions/186.120.227.55|186.120.227.55]] ([[User talk:186.120.227.55#top|talk]]) 22:09, 17 October 2017 (UTC)</small> <!--Autosigned by SineBot-->
:If I'm not mistaken you mean it is a circular definition. Yes there doesn't seem to be a strict definition of what strict means here[[User:Ethanpet113|Ethanpet113]] ([[User talk:Ethanpet113|talk]]) 06:50, 18 November 2018 (UTC)
== No Context ==
There isn't enough context for this article to be useful, what is it that makes a programming paradigm strict. Is it only necessary that arguments to the function must be evaluated before call, or are there other requirements?[[User:Ethanpet113|Ethanpet113]] ([[User talk:Ethanpet113|talk]]) 06:55, 18 November 2018 (UTC)
|