Hi Bill,

I have attached a function DIN which computes the European paper sizes for the different
DIN series (A, B, C, and D) and their scaled variants like A4, C5, etc.

Regarding the issues below, I cannot reproduce them because running them seems to require some .csv
file which I do not have.

However after double-checking Bif_OPER1_EACH::eval_ALB() at the point of the failed assertions,
it looks to me like you may have missed the bug fix that I committed on Aug. 25, 2018 (SVN 1070).

So could you please (1) check if your GNU APL is up to date, and (2) if the error persists, provide a simpler
way to reproduce the fault? According to the assertion, what happens is that a simple scalar is being enclosed
(either explicitly by ⊂, but more likely implicitly by the EACH operator). It would be useful to have the operands
of the failed EACH operator in order to reproduce the fault.

Best Regards,
/// Jürgen Sauerman


On 10/08/2018 06:01 PM, Bill Daly wrote:
Hello Jürgen

I've been working on two projects utl, my utility workspace with better documentation and better function names and lpr, a workspace to print directly from apl.

Now I've melted down the interpretor so I've sent three logs. I'm not sending all the workspace I loaded to create these files. I have updated the repository and one may clone it:

    git clone https://git.code.sf.net/p/apl-library/code apl-library-code

When you look at all this can you consider a few issues?

I've defined a function lpr∆USLetter which returns a lexicon that i need to for the unix pr and lpr commands.  Could you write one for the usual a sized paper sheets?  I started down that road and tripped on my uncontrollable urge to do arithmetic.  I couldn't figure how the priinters work as none of the a sizes seem to easily divided into points.  Here in Pennsylvania where we cling to all sorts of ancient biases one inch = 72 points and thus 12 point type is equal to one sixth of an inch and one letter size page has 66 lines per inch.

Could you also look at date.apl? I've defined a lexicon date-delta-US which in addition to the American month, weekday names defines day_pos, month_pos, and year_pos for those who feel that days come before months.

Thanks for all your help

Bill


∇Z←A DIN B;H0;Area;Series;Scale
⍝⍝ return the heigth and the width of a DIN paper size
⍝
⍝ A: the result unit desired:
⍝    1: return sizes in mm
⍝    2: return sizes in inches (1 inch = 25.4mm)
⍝    3: return sizes in points (1 inch = 72 points)
⍝
⍝ B: the DIN series and scale, e.g. 'A4' for DIN A4 sheets
⍝
⍝ Example: 1 DIN 'A4' returns 297.3017788 210.2241038, which is normally
⍝ rounded to full millimeters: 297÷210 mm²
⍝
⍝ The DIN A series is recursively defined by:
⍝
⍝ 1. the area, i.e. height×width of DIN A0, B0, C0, and D0 sheets
⍝ are 2⋆0, 2⋆0.5, 2⋆0.25 and 2⋆¯0.25 respectively.
⍝
⍝ 2. all formats of a series have the same aspect ratio width÷height.
⍝
⍝ 3. height(An+1) = width(An) ÷ 2
⍝
⍝ that is cutting (or folding) an An sheet at the middle of the longer side
⍝ gives two An+1 sheets.
⍝
⍝ Combining 2. and 3. gives an aspect ratio of 2⋆÷2 = 1.41
⍝
⍝ According to: DIN 476, EN ISO 216
⍝
 (Series Scale)←B            ⍝ split e.g. 'A4' into Series 'A' and Scale '4'
 Area←2⋆(↑(-/⎕UCS Series,'A')↓0 2 1 ¯1)÷4   ⍝ area of A0, B0, C0, 
or D0 in m²
⍝ (Series,'0 area:') Area 'm²'
 H0←(Area×2⋆÷2)⋆÷2            ⍝ height of an A0, B0, C0, or D0 sheet 
in m
⍝ (Series,'0 height:') H0 'm'
 Z←H0÷2⋆(-/⎕UCS Scale,'0')÷2     ⍝ height of an An, Bn, Cn, or Dn 
sheet in mm
 Z←Z×↑A↓0 1000, 10000 720000÷254   ⍝ size in mm, inch, and points
 Z←Z,Z÷2⋆÷2                     ⍝ height → height, width
∇

1 DIN 'A4'
2 DIN 'A4'
3 DIN 'A4'

1 DIN 'A0'
1 DIN 'B2'
1 DIN 'C5'
1 DIN 'D3'

)OFF

Reply via email to