Re: [Jprogramming] Domain error for explicit conjunction

2012-07-13 Thread Raul Miller
On Fri, Jul 13, 2012 at 10:00 AM, Max Harms wrote: > You're suggesting that the lengths of each path be handled in a different > data structure than the paths themselves, yes? That could work, but I'm not > convinced it's actually cleaner than my implementation. While it's true > that it makes thi

Re: [Jprogramming] Domain error for explicit conjunction

2012-07-13 Thread Max Harms
Hey Raul, sorry for the delay in responding. > > I'd like my A* > > program to work on arbitrary graphs, where a step from one space to > another > > can have any non-negative real length. Thus it doesn't work to simply > count > > the length of the path for the general case. > > Can you show me

Re: [Jprogramming] Domain error for explicit conjunction

2012-07-12 Thread Raul Miller
On Wed, Jul 11, 2012 at 1:28 PM, Raul Miller wrote: > I should have been using (|~ #)"1 instead of bare (|~ #). This was wrong. Here's a working implementation of validIn: validIn =: (<@(|~ #)"1 _ { ]) *. (|~ #)"1 _ -:"1 [ Example use: (#~ validIn&(?5 5$2)) <:(#: [: i. */) 2+5 5 -- Raul -

Re: [Jprogramming] Domain error for explicit conjunction

2012-07-11 Thread Raul Miller
On Wed, Jul 11, 2012 at 12:36 PM, Max Harms wrote: > A few aren't what I'm looking for though. One of the biggest is that while > my example happened to have steps with uniform length, I'd like my A* > program to work on arbitrary graphs, where a step from one space to another > can have any non-n

Re: [Jprogramming] Domain error for explicit conjunction

2012-07-11 Thread Max Harms
Thanks, Raul. Some of these changes are great. A few aren't what I'm looking for though. One of the biggest is that while my example happened to have steps with uniform length, I'd like my A* program to work on arbitrary graphs, where a step from one space to another can have any non-negative real

Re: [Jprogramming] Domain error for explicit conjunction

2012-07-10 Thread Raul Miller
There's a change I am tempted to make, but I think it would make the code more complex. So, instead, here's some "simplifications": http://pastebin.com/xa5cgLwF Here's a brief recap of my thinking: J nouns know how big they are, so we should not add complexity to our data structures to keep a r

Re: [Jprogramming] Domain error for explicit conjunction

2012-07-09 Thread Max Harms
Oh, yes. It seems that e. is exactly what I was looking for when I made contains. Thanks. :D - Max On Mon, Jul 9, 2012 at 1:48 PM, Raul Miller wrote: > On Mon, Jul 9, 2012 at 12:14 PM, Max Harms wrote: > > http://pastebin.com/RjQA69j6 > > I put up a slightly modified version of this > > http:

Re: [Jprogramming] Domain error for explicit conjunction

2012-07-09 Thread Raul Miller
On Mon, Jul 9, 2012 at 12:14 PM, Max Harms wrote: > http://pastebin.com/RjQA69j6 I put up a slightly modified version of this http://pastebin.com/diff.php?i=rBmYn6R1 Mostly, I replaced contains with e. I keep thinking I made a mistake, looking at the diffs, but I think that's a pastebin bug.

Re: [Jprogramming] Domain error for explicit conjunction

2012-07-09 Thread Raul Miller
I imagine that it was stuck and not detecting that it's stuck. Your new version worked (after I replaced g with exampleG on the last line. I'll try taking a look at it later today. By the way, my email habits keep wanting me to change your definition of g to #: 51 435 636 652 398 445 154 947

Re: [Jprogramming] Domain error for explicit conjunction

2012-07-09 Thread Max Harms
Sorry. I should've included actual data, rather than a random grid. Try this: g =: 10 10 $ (0 0 0 0 1 1 0 0 1 1 0 1 1 0 1 1 0 0 1 1 1 0 0 1 1 1 1 1 0 0 1 0 1 0 0 0 1 1 0 0 0 1 1 0 0 0 1 1 1 0 0 1 1 0 1 1 1 1 0 1 0 0 1 0 0 1 1 0 1 0 1 1 1 0 1 1 0 0 1 1 1 0 1 1 1 1 1 0 0 1 0 0 0 1 1 1 1 0 0 1) Are

Re: [Jprogramming] Domain error for explicit conjunction

2012-07-09 Thread Raul Miller
I'm running this right now... g =: ? 10 10 $ 2 0 8 ((g gridExtendPath) aStar manhattanDistance) 5 0 ... but it's taking a long time. And without a working example that I can repeat, I cannot easily investigate the numbers. Meanwhile 'Z' (graphExtendPath aStar 1:) 'A' doesn't work becau

Re: [Jprogramming] Domain error for explicit conjunction

2012-07-09 Thread Max Harms
g =: ? 10 10 $ 2 0 8 ((g gridExtendPath) aStar manhattanDistance) 5 0 Hypothetical Dijkstra's Search on an arbitrary graph: 'Z' (graphExtendPath aStar 1:) 'A' Hypothetical A* for hex grid: goal (hexGridExtendPath aStar euclideanDistance) start - Max On Sun, Jul 8, 2012 at 11:02 PM, Raul Miller

Re: [Jprogramming] Domain error for explicit conjunction

2012-07-08 Thread Raul Miller
On Sat, Jul 7, 2012 at 8:59 PM, Max Harms wrote: > Here's the functioning code if you're curious: http://pastebin.com/RjQA69j6 I'm curious. How do you use this? (What are some sample sentences.) [Especially when you are working with adverbs and conjunctions, but also even with verbs, examples

Re: [Jprogramming] Domain error for explicit conjunction

2012-07-07 Thread Max Harms
essage- > From: programming-boun...@jsoftware.com [mailto: > programming-boun...@jsoftware.com] On Behalf Of Max Harms > Sent: Saturday, July 07, 2012 4:43 PM > To: Programming forum > Subject: Re: [Jprogramming] Domain error for explicit conjunction > > Oh. My. Zeus. > > Turns o

Re: [Jprogramming] Domain error for explicit conjunction

2012-07-07 Thread Linda Alvord
Max Harms Sent: Saturday, July 07, 2012 4:43 PM To: Programming forum Subject: Re: [Jprogramming] Domain error for explicit conjunction Oh. My. Zeus. Turns out it works iff the colon is the first character on the line *including whitespace*. When I was writing it I was tabbing-in, and thus

Re: [Jprogramming] Domain error for explicit conjunction

2012-07-07 Thread Linda Alvord
It worked for me as Henry Rich promised on j701jhs Linda -Original Message- From: programming-boun...@jsoftware.com [mailto:programming-boun...@jsoftware.com] On Behalf Of Max Harms Sent: Saturday, July 07, 2012 3:19 PM To: Programming forum Subject: Re: [Jprogramming] Domain error for

Re: [Jprogramming] Domain error for explicit conjunction

2012-07-07 Thread Tracy Harms
The same turns out to be true for version 602. When I tested using version 602 I put the colon as the first character of the line, as is my habit, but with leading whitespace the same error results. On Sat, Jul 7, 2012 at 4:43 PM, Max Harms wrote: > Oh. My. Zeus. > > Turns out it works iff the

Re: [Jprogramming] Domain error for explicit conjunction

2012-07-07 Thread Max Harms
Oh. My. Zeus. Turns out it works iff the colon is the first character on the line *including whitespace*. When I was writing it I was tabbing-in, and thus it was breaking. >_< Thanks a bunch, :) - Max On Sat, Jul 7, 2012 at 4:12 PM, Henry Rich wrote: > Here's a session log > > toy =: 2 :

Re: [Jprogramming] Domain error for explicit conjunction

2012-07-07 Thread Henry Rich
Here's a session log toy =: 2 : 0 : z =: u v '' x + y ) [ toy ] [ (2 : 0) ] : z=:u v'' x+y ) 5 [ toy ] 7 12 You gotta put in the colon : Henry Rich On 7/7/2012 3:18 PM, Max Harms wrote: > Tried it. Didn't work. Same result. (Perhaps because I'm using 701?) > > - Max > > On Sat, Ju

Re: [Jprogramming] Domain error for explicit conjunction

2012-07-07 Thread Eric Iverson
Henry's version works for me in J701. There are relatively few engine differences between 602 and 701. It is much more likely that there is a typo or some human error. I suggest trying again and being very sure everything is proper. Check the display of toy before trying to use it. On Sat, Jul 7,

Re: [Jprogramming] Domain error for explicit conjunction

2012-07-07 Thread Tracy Harms
I have confirmed that Henry's solution works under J6.02 so this does appear to be a flaw in J7 --Tracy On Sat, Jul 7, 2012 at 3:18 PM, Max Harms wrote: > Tried it. Didn't work. Same result. (Perhaps because I'm using 701?) > > - Max > > On Sat, Jul 7, 2012 at 3:12 PM, Henry Rich wrote: > >

Re: [Jprogramming] Domain error for explicit conjunction

2012-07-07 Thread Max Harms
Tried it. Didn't work. Same result. (Perhaps because I'm using 701?) - Max On Sat, Jul 7, 2012 at 3:12 PM, Henry Rich wrote: > You defined a conjunction that produces only a monadic valence. Try > > toy =: 2 : 0 > : > z =: u v '' > x + y > ) > > Henry Rich > > On 7/7/2012 2:38 PM, Max Harms w

Re: [Jprogramming] Domain error for explicit conjunction

2012-07-07 Thread Henry Rich
You defined a conjunction that produces only a monadic valence. Try toy =: 2 : 0 : z =: u v '' x + y ) Henry Rich On 7/7/2012 2:38 PM, Max Harms wrote: > toy =: 2 : 0 > z =: u v '' > x + y > ) -- For information about J forums

[Jprogramming] Domain error for explicit conjunction

2012-07-07 Thread Max Harms
Hello, I'm getting a domain error when I try to invoke (the verb result of) a custom conjunction. I think I boiled it down to this toy example: toy =: 2 : 0 z =: u v '' x + y ) 5 [ toy ] 7 |domain error | 5[toy]7 Any help would be great. :) - Max -