Talk:List comprehensions: Difference between revisions

Line 13:
 
Hi again ShinTakezou, things are never likely to be clear cut, but my thinking on languages is that if list comprehensions are not part of 'standard practice'/in the reference for that language, then even if a computation can be done to mimic list comprehensions, you might never see such list comprehension work-alike in use in example code of that language from books or their website. It would be the problem that I would have with languages that have macro facilities such as C and maybe Lisp, where some'''one''' creates a particular macro definition for a list comprehension and says "look, this language can do it"! How likely is some other programmer to use that implementation when they want to use a list comprehension in that language? How likely are they to be taught that "this is how you do list comprehensions" in the language. In Python, Haskel, and Javascript it is clear-cut, go seeking list comprehensions in those languages and you will be taught the one thing and they will say that it is their languages advised way of supporting set-builder type notation for building lists/iterables. I guess it boils down to "It is a Lisp comprehension because the language designers say it is, and because they had set builder notation in-mind when they were creating the syntax". --[[User:Paddy3118|Paddy3118]] 04:47, 20 April 2009 (UTC)
 
== Appropriate task requirements? ==
 
Is it really appropriate to make language-specific syntax a requirement? When the goal is for a program to be aware of lists and its position in them, would it not be appropriate for glue or translation code to fill in the requirement? For example, consider a language identical to C++, but without the STL. The STL wasn't originally part of the C++ standard, but was adopted later on. Is it appropriate that pre-standardized-STL C++ be excluded from this task, as opposed to C++ once the STL became part of it?
 
Put another way, is the aim of this task to demonstrate how to accomplish a similar end in multiple languages, or is it to filter out languages for which a particular means is not baked into the language's syntax and/or standard? If the latter, why don't we have a task to accomplish the former? And once we were to have the former, why would we need this task, as opposed to identifying the code examples in that task which allow for the more stringent requirements? --[[User:Short Circuit|Short Circuit]] 16:23, 20 April 2009 (UTC)