Rosetta Code:Village Pump/Grouping tasks: Difference between revisions

From Rosetta Code
Content added Content deleted
(more info on lib usage, new heading, more examples, Library and Uses from templates, problem with references generated by templates?)
(and TCLlib seems to have the idea)
Line 49: Line 49:


::: The Alternate D version in counting by primes <nowiki>{{libheader|uiprimes}} Library ''uiprimes'' is a homebrew library to generate prime numbers</nowiki> provides little more and doesn't say where the code is located or if the code is even available.
::: The Alternate D version in counting by primes <nowiki>{{libheader|uiprimes}} Library ''uiprimes'' is a homebrew library to generate prime numbers</nowiki> provides little more and doesn't say where the code is located or if the code is even available.

::: The special case of TCLlib, seems to generate nicely formatted and and well organized content (<nowiki>{{tcllib|struct::list}}</nnowiki> generates '''Library:''' Tcllib ('''Package:''' struct::list). If we had a general form of <nowiki>{{LibraryTemplate|Library Name|member1, member2, ...}}</nowiki>. That would work nicely.


:: --[[User:Dgamey|Dgamey]] 22:50, 18 May 2011 (UTC) Updated: --[[User:Dgamey|Dgamey]] 02:20, 19 May 2011 (UTC)
:: --[[User:Dgamey|Dgamey]] 22:50, 18 May 2011 (UTC) Updated: --[[User:Dgamey|Dgamey]] 02:20, 19 May 2011 (UTC)

Revision as of 02:28, 19 May 2011

Grouping tasks
This is a particular discussion thread among many which consider Rosetta Code.

Summary

A request to categorize some programming tasks

Discussion

I would like to group these tasks in [[Category:Higher-order functions]].

However, the system of categories under Category:Solutions by Programming Task is to difficult for me to understand, so I will not yet group these tasks. I just learned that Template:Task takes a parameter (as {{task|something goes here}}). --Kernigh 17:31, 20 April 2011 (UTC)

Yeah I had tried to organize the tasks long ago, but it didn't work as well as I had hoped. It would be a little easier to understand with the category tree extension, but it still wouldn't be that good. The argument for the task template is for a category to put it in. I say go ahead and make the category. I think people use Category:Programming Tasks in general anyway, so it won't confuse people. If you can think of any more groups go ahead and suggest them here. Maybe we can give the organization another shot. --Mwn3d 17:54, 20 April 2011 (UTC)
BTW. I like the classifications of function-functions above. --Dgamey 22:50, 18 May 2011 (UTC)
I did a quick analysis of classifications on RC Analysis of Rosetta Programming Categories as part trying to understand how the classifications evolved (for another purpose). This may be of use. Feel free to copy it for this purpose.
It seems to me that there are opportunities where consolidation is in order. Do we really need Prime, Primes, and Prime Numbers? Would we want to fix and have redirects?
It's also clear that things have been misfiled over time.
And there a quite a few with one member in the category as well.
I started to look at Crypto classes at Talk:RSA_code#New.2FModified_Tasks_and_Categories as well.
I know that SML may change the way this gets approached. I haven't made any progress on that myself, anyone else?
Thoughts? --Dgamey 21:38, 17 May 2011 (UTC)

Phantom Categories

I was trying to test cleaning up some categories of tasks and thought I'd start with Primes, Prime, and Prime Numbers. So I added the Category:Prime Numbers to the page but low and behold I can't find where Truncatable_primes references Primes. In the html source there is a "wgCategories=[" inside a script and I can see at the bottom where a "Category:Primes (page does not exist)" is generated but I can't find where to fix this. This also appears this is the case with the single member of the Prime category. Help? --Dgamey 10:31, 18 May 2011 (UTC)
Bingo! These appear to be caused by the incorrect use of Library templates. Rather than reference the library as a whole, people are referencing the module within it creating an entire category for a single non-unique member. Not sure if it's just careless use or if there isn't enough supporting documentation in the template.
So far I've seen this in D, Haskell, and Ruby code.
I haven't yet started to go around marking these examples incorrect yet. Likely I will after its been looked into a bit more.
Question, is there an easy way to get a list of all pages using the Library template? Or is this an easy bot (if the problem is large enough - mark Library references to non-created pages in error)?
--Dgamey 11:45, 18 May 2011 (UTC)
Go to the template page and click on the "what links here" link on the bottom left. That will show you all the pages that use a template (as well as ones that link to it directly). --Mwn3d 12:25, 18 May 2011 (UTC)

Library/Libheader appears to be being used incorrectly

I really think more is going on here and somethings aren't working as expected.
A comment on one of the pages in question suggested the library may be correct and that disambiguation may be need like Library: prime (language). I'm not convinced if there is a library or package called primes that it would not have a broader name like the well known hosting site or such. The RC template Template:Library has no documentation about what is expected/required so there is little surprise that people use the template differently. At least one attempt to get more information was made in 2009 but it didn't seem to go anywhere. Even if we conclude that a certain use is wrong, we'd need to go around an mark the pages needs improvement or similar. Examples:
Using {{libheader|Primes}} from [http://hackage.haskell.org/packages/hackage.html HackageDB] - creates Primes and formats in an ugly fashion. The code refers to HackageDB (which I would take to be the library and primes the package.
{{libheader|Icon Programming Library}} [http://www.cs.arizona.edu/icon/library/src/procs/strings.icn strings.icn provides deletec and sortc]</wiki> This allows for the category page to represent the entire library rather than a single member. ::: vs. something else. What is intended? I see an example that includes: <nowiki>{{libheader|GTK}}{{libheader|GtkAda}}{{uses from|library|GtkAda|component1=Window|component2=Widget|component3=Handlers|component4=Main}} which seems much along the lines of what I would have expected. Except that the libheader for GtkAda and the uses from point at different pages (GtkAda and Library/GtkAda).
The example in Ruby provides no useful information on the source of the library {{libheader|optparse}}{{libheader|prime}}
The Alternate D version in counting by primes {{libheader|uiprimes}} Library ''uiprimes'' is a homebrew library to generate prime numbers provides little more and doesn't say where the code is located or if the code is even available.
The special case of TCLlib, seems to generate nicely formatted and and well organized content ({{tcllib|struct::list}}</nnowiki> generates '''Library:''' Tcllib ('''Package:''' struct::list). If we had a general form of <nowiki>{{LibraryTemplate|Library Name|member1, member2, ...}}. That would work nicely.
--Dgamey 22:50, 18 May 2011 (UTC) Updated: --Dgamey 02:20, 19 May 2011 (UTC)