User talk:DanBron: Difference between revisions

From Rosetta Code
Content added Content deleted
(J alphabet gaps)
Line 10: Line 10:
({~i.&.-:@#)('"'&= <;. _1 ]) xmlread
({~i.&.-:@#)('"'&= <;. _1 ]) xmlread
any comments? --[[User:Gaaijz|Gaaijz]] 16:12, 21 January 2009 (UTC)
any comments? --[[User:Gaaijz|Gaaijz]] 16:12, 21 January 2009 (UTC)

:I added XML reading. For this particular task, I think the XSLT library is best suited. What script defines <tt>xmlread</tt> in your example? I couldn't find it anywhere in the base library or addons.
:Regarding Jensen's Device, J doesn't really have semantics of the type needed. The only two approaches I can think of entail exploiting mapped files or the parse rules which stack names (e.g. the proverb rule). Unfortunately passing by name isn't sufficient; for Jensen's Device (at least the example given), you need the exact ''expression'' that calculated the parameter (in this case, we need to be able to say <tt>some_verb 0;1;100;1 % i</tt> and give the verb access to the expression <tt>1%i</tt> rather than just its result. AFAICT, this isn't really possible in J, without quoting the expression, which evades the spirit of the task.

:Perhaps it'd be easier to create a new task starting with J. The idea has a certain poetry (given that we're the J task force).
:--[[User:DanBron|DanBron]] 20:22, 23 January 2009 (UTC)

Revision as of 20:22, 23 January 2009

Welcome, Dan, and thanks for contributing! Your tasks have been interesting, and a couple have been getting blog coverage from outside RC. Keep it up! I'm Mike, and I'm the head honcho around here, though there are several more-active users than I am. If you need anything, or have questions, write something in the Village Pump; We've got a great community of active coders from a variety of programming schools. --Short Circuit 06:30, 5 August 2008 (UTC)

Reply J-ers

Hi Dan. I noticed your and TBH's activity on this wiki. Now you mention it, in time I'll think about a rabbit sequence task. --Gaaijz 07:48, 6 September 2008 (UTC)

Generic Swap

Hi Dan. Are these reasonable candidates? Have a look at my scratch pad/sandbox wiki pages: [1] --Gaaijz 08:23, 29 September 2008 (UTC)

Yep! If I were you, I might lead with the primitive solution, |., and express the composite solution without parenthesis, as ,~/. You might also want to explicitly state that J is dynamically typed, so the solution is trivial. --DanBron 16:01, 29 September 2008 (UTC)

J alphabet gaps

Dan, still 2 to go (AFAICS), making J alphabetic complete: J and X. Is 'Jensen Device' possible? For the 'X' I have for 'XML reading' the following 'specialized' solution:

 ({~i.&.-:@#)('"'&= <;. _1 ]) xmlread

any comments? --Gaaijz 16:12, 21 January 2009 (UTC)

I added XML reading. For this particular task, I think the XSLT library is best suited. What script defines xmlread in your example? I couldn't find it anywhere in the base library or addons.
Regarding Jensen's Device, J doesn't really have semantics of the type needed. The only two approaches I can think of entail exploiting mapped files or the parse rules which stack names (e.g. the proverb rule). Unfortunately passing by name isn't sufficient; for Jensen's Device (at least the example given), you need the exact expression that calculated the parameter (in this case, we need to be able to say some_verb 0;1;100;1 % i and give the verb access to the expression 1%i rather than just its result. AFAICT, this isn't really possible in J, without quoting the expression, which evades the spirit of the task.
Perhaps it'd be easier to create a new task starting with J. The idea has a certain poetry (given that we're the J task force).
--DanBron 20:22, 23 January 2009 (UTC)