Intuition, aesthetics and performance
15 posts
• Page 2 of 2 • 1, 2
Re: Intuition, aesthetics and performance
Regarding a {⍺,⍺⍺,⍵}/ idiom:
I like the idea because it would turn an intuitive way to write this interleaving from an n-squared into a linear algorithm. I have logged an RFE (ref 5750) to this effect.
However, {⍺,⍺⍺,⍵}/ is an incomplete expression (a conjunction of two operators) and so could not be named. We might have to consider a more complex idiom:
John.
I like the idea because it would turn an intuitive way to write this interleaving from an n-squared into a linear algorithm. I have logged an RFE (ref 5750) to this effect.
However, {⍺,⍺⍺,⍵}/ is an incomplete expression (a conjunction of two operators) and so could not be named. We might have to consider a more complex idiom:
- Code: Select all
sandwich ← {↑⍺{⍺,⍺⍺,⍵}/⍵} ⍝ sandwich idiom.
'-' sandwich 'now' 'is' 'the' 'time'
now-is-the-time
John.
- JohnS|Dyalog
Re: Intuition, aesthetics and performance
John'S £2E¯2J0's worth regarding ⎕PATH:
I think there are broadly two markets for a name-finding mechanism.
[1] The first is global and is used to locate utility functions from within any namespace. It is handy to be able to type "display" at the front of an expression, or inject "time" between a function and it's argument, irrespective of where I am in the namespace hierarchy.
[2] The second is more like a language "include" statement and is specific to a particular namespace.
⎕PATH implements the first of these; it is modelled on the opsys library path concept, where, happily, DIR, ls and pwd mean the same wherever I happen to be :-)
V12.1's user-command system: ]display, &co have to some extent replaced the need for [1].
We don't have an equivalent mechanism for [2]. Perhaps we should.
I think there are broadly two markets for a name-finding mechanism.
[1] The first is global and is used to locate utility functions from within any namespace. It is handy to be able to type "display" at the front of an expression, or inject "time" between a function and it's argument, irrespective of where I am in the namespace hierarchy.
[2] The second is more like a language "include" statement and is specific to a particular namespace.
⎕PATH implements the first of these; it is modelled on the opsys library path concept, where, happily, DIR, ls and pwd mean the same wherever I happen to be :-)
V12.1's user-command system: ]display, &co have to some extent replaced the need for [1].
We don't have an equivalent mechanism for [2]. Perhaps we should.
- JohnS|Dyalog
Re: Intuition, aesthetics and performance
I also like that but was confused by
↑'-'{⍺,⍺⍺,'E',⍵,'D'}/'now' 'is' 'the' 'time'
giving
now-Eis-Ethe-EtimeDDD
↑'-'{⍺,⍺⍺,'E',⍵,'D'}/'now' 'is' 'the' 'time'
giving
now-Eis-Ethe-EtimeDDD
-
MikeHughes - Posts: 86
- Joined: Thu Nov 26, 2009 9:03 am
- Location: Market Harborough, Leicestershire, UK
Re: Intuition, aesthetics and performance
MikeHughes wrote:↑'-'{⍺,⍺⍺,'E',⍵,'D'}/'now' 'is' 'the' 'time'
In any expression:
⊃{... ⍵ ...}/list
⍵ is the result so far from all iterations. In the above case first it's 'time' then the result from 'the'{...}'time' and so on.
Catenating your 'D' to the right of ⍵ means they're all going to be tacked on the end.
-
Phil Last - Posts: 628
- Joined: Thu Jun 18, 2009 6:29 pm
- Location: Wessex
Re: Intuition, aesthetics and performance
Sorry Im a pratt of course you are right - I fell off a lorry last week - still havent recovered fully obviously :-D
-
MikeHughes - Posts: 86
- Joined: Thu Nov 26, 2009 9:03 am
- Location: Market Harborough, Leicestershire, UK
15 posts
• Page 2 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 1 guest
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group