Talk:Scheme (programming language): Difference between revisions

Content deleted Content added
Sokleidas (talk | contribs)
rv 2023 test edit
 
(18 intermediate revisions by 13 users not shown)
Line 1:
{{Talk header}}
{{ArticleHistory|action1=PR
|action1date=10:48, 20 June 2006
Line 25 ⟶ 26:
|currentstatus=failedGA
}}
{{WikiProject Computingbanner shell|class=B|
{{WikiProject Computing|importance=low
|science=yes
|science-importance=mid
}}
}}
{{archives
Line 34 ⟶ 36:
| list=<center>[[/Archive 1|2003–2007]]</center>
}}
 
== Tail-recursion example is not tail-recursive ==
 
I think the example shown under ‘proper tail recursion’ does not actually use tail recursion because the call to the loop function is not directly returned from the function. The return value is instead passed to a call to ‘cons’ which would mean it has to maintain the call stack and can't optimise away the call. I think it would have to be something like this to use tail-call recursion:
 
<syntaxhighlight lang="scheme">
(define (list-of-squares n)
(let loop ((i n) (res '()))
(if (< i 0)
res
(loop (- i 1) (cons (* i i) res)))))
</syntaxhighlight>
[[User:SokleidasBpeel|SokleidasBpeel]] ([[User talk:SokleidasBpeel|talk]]) 2116:5304, 727 November 2012 (UTC)
 
As there was no response to my message I've just gone ahead and replaced the sample with the one above.
[[User:Bpeel|Bpeel]] ([[User talk:Bpeel|talk]]) 17:46, 20 December 2012 (UTC)
 
== Comments ==
Line 109 ⟶ 127:
 
Theres a statement in the wording that SCHEME is the easiest language of comparable power to implement. Is this REALLY true? I've seen some DAMN slim versions of Forth, and although it was never as fashionable for its stack-y ways, it was always a pretty expressive language and surprisingly capable for the kind of metaprogramming the lisps where known for. [[Special:Contributions/121.45.251.215|121.45.251.215]] ([[User talk:121.45.251.215|talk]]) 12:07, 9 October 2011 (UTC)
 
== "Popular with programmers, implementors and hobbyists" ==
 
This sentence in the first paragraph seems completely meaningless: "Its compactness and elegance have made it popular with educators, language designers, programmers, implementors, and hobbyists."
 
Wouldn't it make sense to either simply state that "It is popular for its compactness", or to remove the overly broad and ambiguous "programmers, implementors, and hobbyists"? [[Special:Contributions/174.1.213.234|174.1.213.234]] ([[User talk:174.1.213.234|talk]]) 17:02, 20 May 2013 (UTC)
 
:Changing that. [[User:Qwertyus|Q<small>VVERTYVS</small>]] <small>([[User talk:Qwertyus|hm?]])</small> 07:19, 19 July 2013 (UTC)
 
== The Hofstaedter example ==
Line 134 ⟶ 160:
==> ((1 0) (1 0) (2 1) (2 2) (3 2) (3 3) (4 4) (5 4) (5 5))
</syntaxhighlight>
 
[[User:Sokleidas|Sokleidas]] ([[User talk:Sokleidas|talk]]) 21:53, 7 November 2012 (UTC)
It is of course a matter of taste and style, but functional parts of a program should be separated from imperative parts (cf. e. g. Conrad Barski, Land of Lisp, San Francisco 2011, p. 302). Displaying the results could be done with <code>for-each</code>, which according to R5RS is explicitly to be called because of its side-effects:
 
<syntaxhighlight lang="Scheme">
(for-each (lambda (item)
(begin
(display (car item))
(display " ")
(display (cdr item))
(display "\n")))
(hofstaedter-male-female 8))
 
===> #<unspecified>
 
1 0
1 0
2 1
2 2
3 2
3 3
4 4
5 4
5 5
</syntaxhighlight>
[[User:Sokleidas|Sokleidas]] ([[User talk:Sokleidas|talk]]) 22:30, 7 November 2012 (UTC)
 
== R7RS ==
 
What's up with that? The article seems out-of-date on that. Far as I can tell it's been delayed quite a bit, but then I don't follow Scheme news at all. --[[Special:Contributions/82.128.250.221|82.128.250.221]] ([[User talk:82.128.250.221|talk]]) 10:19, 31 March 2014 (UTC)
 
:I've updated the panel on the right, as R7RS has been officially ratified. But we should also state that in the introduction, where R6RS is mentioned as the new standard. [[User:Csl77|cslarsen]] ([[User talk:Csl77|talk]]) 11:30, 29 December 2014 (UTC)
 
== The first paragraph should not mention Common Lisp ==
 
The header needs to focus more on Scheme exclusively. [[Special:Contributions/137.124.161.12|137.124.161.12]] ([[User talk:137.124.161.12|talk]]) 02:30, 29 January 2016 (UTC)
 
:I think it's quite natural that the first paragraph does mention Common Lisp, if only to emphasize the minimalist philosophy behind Scheme's design and contrast it with the "everything and the kitchen sink" philosophy underlying the design of Common Lisp (which explicity tried to merge the features of the various dialects of (Mac)Lisp). However, I agree that the concrete wording of the first paragraph seems uneven.
:The first paragraph {{oldid|Scheme (programming language)|701085086|currently has this to say}}:
::'''Scheme''' and [[Common Lisp]] are the two principal [[Programming language dialect|dialect]]s of the [[Programming language|computer programming language]] [[Lisp (programming language)|Lisp]]. Unlike Common Lisp, Scheme follows a [[Minimalism (computing)|minimalist]] design philosophy that specifies a small standard core accompanied by powerful tools for language extension.
:It used to read {{oldid|Scheme (programming language)|637554029|like this}}:
::'''Scheme''' is a [[functional programming]] language and one of the two main [[programming language dialect|dialects]] of the programming language [[Lisp programming language|Lisp]]. Unlike [[Common Lisp]], the other main dialect, Scheme follows a [[Minimalism (computing)|minimalist]] design philosophy specifying a small standard core with powerful tools for language extension.
:Even though both versions offer the same content, I think I prefer the older version. —[[User:Tobias Bergemann|Tobias Bergemann]] ([[User talk:Tobias Bergemann|talk]]) 08:40, 29 January 2016 (UTC)
 
::I have restored the first paragraph to the version of 2014-12-11. —[[User:Tobias Bergemann|Tobias Bergemann]] ([[User talk:Tobias Bergemann|talk]]) 07:39, 5 February 2016 (UTC)