[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-apl] Two questions
From: |
Christian Robert |
Subject: |
[Bug-apl] Two questions |
Date: |
Fri, 27 Mar 2015 21:18:19 -0400 |
User-agent: |
Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 |
)clear
CLEAR WS
⎕pw←500
)copy Convert2 ∆length
SAVED 2015-03-27 16:52:16 (GMT-4)
24 ⎕cr ⊃
┌2─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│┌5────┐
┌13──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐│
││meter│ 2┌2─┐ ┌2─┐ ┌2─┐ ┌2─┐ ┌2─┐ ┌5────┐ ┌2─┐ ┌9────────┐
┌6─────┐ ┌4───┐ ┌4───┐ ┌4───┐ ┌4───┐ ││
│└─────┘ ││nm│ │um│ │mm│ │cm│ │dc│ │meter│ │km│ │lightyear│
│parsec│ │inch│ │feet│ │yard│ │mile│ ││
│ │└──┘ └──┘ └──┘ └──┘ └──┘ └─────┘ └──┘ └─────────┘
└──────┘ └────┘ └────┘ └────┘ └────┘ ││
│ │┌5────┐ ┌5────┐ ┌6─────┐ ┌5────┐ ┌4───┐ ┌→┐ ┌6─────┐
┌18────────────────┐ ┌14────────────┐ ┌8───────┐ ┌8───────┐ ┌8───────┐
┌10────────┐││
│ ││v÷1E9│ │v÷1E6│ │v÷1000│ │v÷100│ │v÷10│ │v│ │v×1000│
│v×9454254955488000│ │v×3.0856776E16│ │v×0.0254│ │v×0.3048│ │v×0.9144│
│v×1609.344│││
│ │└─────┘ └─────┘ └──────┘ └─────┘ └────┘ └─┘ └──────┘
└──────────────────┘ └──────────────┘ └────────┘ └────────┘ └────────┘
└──────────┘││
│
└∊───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘│
└∊∊────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
My first first question is, is there any method to update the formula into
'∆length' for example
to change the 'v×9454254955488000' into for example 'v×9454254955488E3' in a
single line assignement
without using any temporary variables ?
I though I can do that with the diadic '⊃' but did not succeed.
My second question is about ")dump sample" of this workspace (to include it in
this mail);
on reload of sample the '∆length' variable is different from the original one.
See the first 4 lines of this email.
I've also seen some days ago "2 ⎕tf 'varname'" removing an "∊" from what it
supposed to do, may be related.
I Know that 2 questions in one mail is bad, but you can answer one at a time.
Xtian.
∆length←'meter' (2 13⍴'nm' 'um' 'mm' 'cm' 'dc' 'meter' 'km' 'lightyear'
'parsec' 'inch' 'feet' 'yard' 'mile' 'v÷1E9' 'v÷1E6' 'v÷1000' 'v÷100' 'v÷10'
'v' 'v×1000' 'v×9454254955488000' 'v×3.0856776E16' 'v×0.0254' 'v×0.3048'
'v×0.9144' 'v×1609.344')
- [Bug-apl] Two questions,
Christian Robert <=