Finn Idiom problems and Re: {rho} problem 
Author Message
 Finn Idiom problems and Re: {rho} problem


Quote:

>> Attempting to utilize the {rho} function yielded what Mike Cowlishaw would
>> refer to as a 'suprising result'. Eg:

And that was a mangled quote, should be 'high astonishment factor'.

Quote:
>>    {rho}'{lamp}'

>> returns null! I expected a result of 1. A {quad}DR of the above indicates
>> integer.
> '{lamp}' is a scalar and not a vector!
> '{lamp}B' is a vector
> {rho},'{lamp} returns 1, as it is a vector.
> The same aplies to Numbers: 1  : scalar,  1 2 : vector.
> Vectornotation requires at least 2 items.

Ah, of course! And that means that Finn idiom 322 has a bug. It will fail if
the string is a single character. Although it does specify that the string
must be a vector, an improved version is:

   (M is a matrix, and S is a string)

   ((((1{take}{rho}M),{rho},S){take}M)^.=S){slash bar}M

           added comma ----^

Returning the index of the rows, rather than the rows themselves:

   ((((1{take}{rho}M),{rho},S){take}M)^.=S)/{iota}1{take}{rho}M

And idiom 94 (decimal to hex) as listed can't be trusted for values over
decimal 255. A replacement posted by one of the good folk on the list
in response to one of my posts; good for any decimal value is:

  (D is decimal)

  {transpose}'0123456789ABCDEF'[{quad}IO+(({ceiling}/1{ceiling}{ceiling} {+
   +} 16{log}1+,D){rho}16){encode}D]

Idioms 300 and 301 are the same.
Idioms 299 and 662 are residual non functional junk.

Olli? Will you update the Idiom list?

--



Sat, 21 Jan 2006 17:58:25 GMT  
 Finn Idiom problems and Re: {rho} problem
Jerry, i am afraid Olli doesn't follow this newsgroup. Afaik, it's only me
and Veli-Matti. I'd advice you to write directly to the FinnAPL Webmaster
(that's Olli) or similar. Check out the contact info among the pages.

Regards / Tomas


Quote:


> >> Attempting to utilize the {rho} function yielded what Mike Cowlishaw
would
> >> refer to as a 'suprising result'. Eg:

> And that was a mangled quote, should be 'high astonishment factor'.

> >>    {rho}'{lamp}'

> >> returns null! I expected a result of 1. A {quad}DR of the above
indicates
> >> integer.

> > '{lamp}' is a scalar and not a vector!
> > '{lamp}B' is a vector
> > {rho},'{lamp} returns 1, as it is a vector.
> > The same aplies to Numbers: 1  : scalar,  1 2 : vector.
> > Vectornotation requires at least 2 items.

> Ah, of course! And that means that Finn idiom 322 has a bug. It will fail
if
> the string is a single character. Although it does specify that the string
> must be a vector, an improved version is:

>    (M is a matrix, and S is a string)

>    ((((1{take}{rho}M),{rho},S){take}M)^.=S){slash bar}M

>            added comma ----^

> Returning the index of the rows, rather than the rows themselves:

>    ((((1{take}{rho}M),{rho},S){take}M)^.=S)/{iota}1{take}{rho}M

> And idiom 94 (decimal to hex) as listed can't be trusted for values over
> decimal 255. A replacement posted by one of the good folk on the list
> in response to one of my posts; good for any decimal value is:

>   (D is decimal)

>   {transpose}'0123456789ABCDEF'[{quad}IO+(({ceiling}/1{ceiling}{ceiling}
{+
>    +} 16{log}1+,D){rho}16){encode}D]

> Idioms 300 and 301 are the same.
> Idioms 299 and 662 are residual non functional junk.

> Olli? Will you update the Idiom list?

> --




Sat, 21 Jan 2006 18:31:47 GMT  
 Finn Idiom problems and Re: {rho} problem

Quote:



> >> Attempting to utilize the {rho} function yielded what Mike Cowlishaw would
> >> refer to as a 'suprising result'. Eg:

> And that was a mangled quote, should be 'high astonishment factor'.

> >>    {rho}'{lamp}'

> >> returns null! I expected a result of 1. A {quad}DR of the above indicates
> >> integer.

> > '{lamp}' is a scalar and not a vector!
> > '{lamp}B' is a vector
> > {rho},'{lamp} returns 1, as it is a vector.
> > The same aplies to Numbers: 1  : scalar,  1 2 : vector.
> > Vectornotation requires at least 2 items.

> Ah, of course! And that means that Finn idiom 322 has a bug. It will fail if
> the string is a single character. Although it does specify that the string
> must be a vector, an improved version is:

>    (M is a matrix, and S is a string)

>    ((((1{take}{rho}M),{rho},S){take}M)^.=S){slash bar}M

>            added comma ----^

> Returning the index of the rows, rather than the rows themselves:

>    ((((1{take}{rho}M),{rho},S){take}M)^.=S)/{iota}1{take}{rho}M

> And idiom 94 (decimal to hex) as listed can't be trusted for values over
> decimal 255. A replacement posted by one of the good folk on the list
> in response to one of my posts; good for any decimal value is:

>   (D is decimal)

>   {transpose}'0123456789ABCDEF'[{quad}IO+(({ceiling}/1{ceiling}{ceiling} {+
>    +} 16{log}1+,D){rho}16){encode}D]

> Idioms 300 and 301 are the same.
> Idioms 299 and 662 are residual non functional junk.

> Olli? Will you update the Idiom list?

> --


{rho}'x' was a vector in the older APL's (e.g. APL/360).  It's a scalar
in APL2.

Easy fix:  1/x changes scalar x to a one element vector but has no
effect on any other shape.

      {rho}1/3              
1                          
      {rho}1/{iota}3        
3                          
      {rho}1/3 3{rho}{iota}5
3 3                        
      {rho}1/(1 2)'abc'    
2



Sun, 22 Jan 2006 00:28:50 GMT  
 Finn Idiom problems and Re: {rho} problem


Quote:
> {rho}'x' was a vector in the older APL's (e.g. APL/360). It's a scalar
> in APL2.

I am sorry Ted, but (rho) x still is a vector in APL2-

at least in the dialects delivered by IBM, Dyalog and APL2000 (or
whatever happens to be the name right now ;-)



Sun, 22 Jan 2006 07:39:15 GMT  
 Finn Idiom problems and Re: {rho} problem
In Dyalog APL, version 9

     rho rho 5
0

     rho rho ,5
1

-- James L. Ryan -- TaliesinSoft



Sun, 22 Jan 2006 07:40:37 GMT  
 Finn Idiom problems and Re: {rho} problem

Quote:


> > {rho}'x' was a vector in the older APL's (e.g. APL/360). It's a scalar
> > in APL2.
> I am sorry Ted, but (rho) x still is a vector in APL2-

> at least in the dialects delivered by IBM, Dyalog and APL2000 (or
> whatever happens to be the name right now ;-)

Nope.  I run APL2 for OS/2:
      'x'

      'x'
0
the mu is the ASCII representation of {rho}.  For the sake of evidence,
I just cut and pasted the example.

Ted



Sun, 22 Jan 2006 11:08:00 GMT  
 Finn Idiom problems and Re: {rho} problem

Quote:

> In Dyalog APL, version 9

>      rho rho 5
> 0

>      rho rho ,5
> 1

I think that's true in almost all APLs.  The question involved a
character singleton.

Ted



Sun, 22 Jan 2006 11:08:02 GMT  
 Finn Idiom problems and Re: {rho} problem
On Tue, 5 Aug 2003 23:08:02 -0400, Ted Edwards wrote

Quote:

>> In Dyalog APL, version 9

>> rho rho 5
>> 0

>> rho rho ,5
>> 1

> I think that's true in almost all APLs.  The question involved a
> character singleton.

> Ted

I was curious as to how long it would take someone to note that I had
commented on numeric as opposed to character arguments.

Again, in Dyalog APL, version 9

rho rho 'x'
0

rho rho ,'x'
1

-- James L. Ryan -- TaliesinSoft



Sun, 22 Jan 2006 11:57:34 GMT  
 Finn Idiom problems and Re: {rho} problem

writes

Quote:


>> > {rho}'x' was a vector in the older APL's (e.g. APL/360). It's a scalar
>> > in APL2.

>> I am sorry Ted, but (rho) x still is a vector in APL2-

>> at least in the dialects delivered by IBM, Dyalog and APL2000 (or
>> whatever happens to be the name right now ;-)

>Nope.

Yep.

Quote:
> I run APL2 for OS/2:
>      'x'

Ted, this result of <rho>'x' is definitely a vector. It is a null
vector, i.e. a vector of length zero ...

Quote:
>      'x'
>0

... as evidenced here.

Quote:
>the mu is the ASCII representation of {rho}.  For the sake of evidence,
>I just cut and pasted the example.

>Ted

--
John Sullivan
Please note that any disclaimer on email to me does not
apply, because I have not agreed with it. If your lawyers
disagree, please ask them to study the law of contract.


Sun, 22 Jan 2006 14:49:54 GMT  
 Finn Idiom problems and Re: {rho} problem

Quote:

> >> I am sorry Ted, but (rho) x still is a vector in APL2-
> Ted, this result of <rho>'x' is definitely a vector. It is a null
> vector, i.e. a vector of length zero ...

Ahhh.  I see where the confusion lies.  Of course {rho}x is a vector.
The result of {rho}x is always a vector regardless of the nature of x.
The point under discussion is the nature of 'x' - a character
singleton.  In APL/360, it is a one element vector, i.e. {rho}'x' was
,1.  In APL/2, it is a scalar i.e. {rho}'x' is {iota}0.

It is the properties of the string we were concerned with.  My
suggestion was to replace x in the idiom with 1/x.  This will convert a
scalar to a one element vector without changing the structure of any
non-scalar x.

Ted



Mon, 23 Jan 2006 02:41:17 GMT  
 Finn Idiom problems and Re: {rho} problem

Quote:

> Again, in Dyalog APL, version 9

> rho rho 'x'
> 0

> rho rho ,'x'
> 1

That works fine where you can gaurantee x is a scalar or vector.
{rho} {rho}1/'x' is also 1 but any structure other than a scalar is
unchanged.  I have found this useful in a number of cases where I wanted
to avoid an empty {rho}.

Ted



Mon, 23 Jan 2006 02:41:19 GMT  
 
 [ 11 post ] 

 Relevant Pages 

1. Fonts for Finn APL Idiom Library

2. {rho} problem

3. tcl idiom for a simple problem?

4. Problems, problems, problems

5. Eiffel Problems, Problems, Problems

6. Paging Andrew Finn

7. v.polar = rho, theta

8. Combinatorial Problem [ & a new Combinatorial Problem ]

9. Database problem/Memory problem??

10. CW 2003 - Focus problem & a select problem

11. 32bit problem - one problem solved & another found

12. GForth problem or my problem?

 

 
Powered by phpBB® Forum Software