Skip to content

Commit

Permalink
stdlib
Browse files Browse the repository at this point in the history
  • Loading branch information
bilam committed Dec 27, 2024
1 parent 98cfe8b commit 4a8bb87
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 14 deletions.
10 changes: 9 additions & 1 deletion jlibrary/addons/data/jmf/jmf.ijs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,15 @@ share name;sharename[;mt] - share 'sharename' as name
MAPNAME,MAPFN,... showmap col indexes
)
memhad_z_=: [: {: [: memr 0 2 4 ,~ (15!:6)@<
3 : 0''
try.
15!:12 <'a' [ a=. i.5
memhad_z_=: (15!:12)@<
catch.
memhad_z_=: [: {: [: memr 0 2 4 ,~ (15!:6)@<
end.
EMPTY
)
memdad_z_=: 15!:14@<

0 : 0
Expand Down
2 changes: 1 addition & 1 deletion jlibrary/addons/data/jmf/manifest.ijs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ DESCRIPTION=: 0 : 0
J Memory Mapped File
)

VERSION=: '1.0.43'
VERSION=: '1.0.44'

RELEASE=: ''

Expand Down
24 changes: 12 additions & 12 deletions jlibrary/addons/data/jmf/test/testjmf.ijs
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,18 @@ NB. test jmf file with 0/1/2 map types
map_jmf_ 'abc';F;'';MTRW_jmf_ NB. 0 maptype
assert 'def'-:abc
abc=: 'ghi'
m=. mappings
m=. mappings_jmf_
remap_jmf_'abc'
assert m-:mappings
assert m-:mappings_jmf_
unmap_jmf_'abc'

map_jmf_ 'abc';F;'';MTRO_jmf_ NB. RO maptype
assert 'ghi'-:abc
try. abc=: 'jkl' catch. end.
assert 'ghi'-:abc
m=. mappings
m=. mappings_jmf_
remap_jmf_'abc'
assert m-:mappings
assert m-:mappings_jmf_
unmap_jmf_'abc'

map_jmf_ 'abc';F;'';MTCW_jmf_ NB. COW (copy on write) maptype
Expand All @@ -65,9 +65,9 @@ assert abc-:'jkl'
unmap_jmf_'abc'
map_jmf_ 'abc';F;'';MTRO_jmf_
assert 'ghi'-:abc NB. verify =: did not change file
m=. mappings
m=. mappings_jmf_
remap_jmf_'abc'
assert m-:mappings
assert m-:mappings_jmf_
unmap_jmf_'abc'

NB. test nonjmf file with 0/1/2 maptypes
Expand All @@ -80,18 +80,18 @@ abc=: '6789'
unmap_jmf_'abc'
JCHAR map_jmf_ 'abc';F;'';0
assert '6789'-:abc
m=. mappings
m=. mappings_jmf_
remap_jmf_'abc'
assert m-:mappings
assert m-:mappings_jmf_
unmap_jmf_'abc'

JCHAR map_jmf_ 'abc';F;'';1 NB. RO
assert '6789'-:abc
try. abc=: '9999' catch. end.
assert '6789'-:abc
m=. mappings
m=. mappings_jmf_
remap_jmf_'abc'
assert m-:mappings
assert m-:mappings_jmf_
unmap_jmf_'abc'

JCHAR map_jmf_ 'abc';F;'';2 NB. COW (copy on write) maptype
Expand All @@ -101,9 +101,9 @@ assert abc-:'jkl'
unmap_jmf_'abc'
JCHAR map_jmf_ 'abc';F;'';0
assert '6789'-:abc NB. verify =: did not change file
m=. mappings
m=. mappings_jmf_
remap_jmf_'abc'
assert m-:mappings
assert m-:mappings_jmf_
unmap_jmf_'abc'
echo 'testmaptype end'
i.0 0
Expand Down
2 changes: 2 additions & 0 deletions jlibrary/system/main/stdlib.ijs
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,9 @@ cder=: 15!:10
cderx=: 15!:11
symget=: 15!:6
symset=: 15!:7
symdad=: 15!:14
symdat=: 15!:14
symhad=: 15!:12
cdcb=: 15!:13
JB01=: 1
JCHAR=: 2
Expand Down

0 comments on commit 4a8bb87

Please sign in to comment.