Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dbsig ignores x argument when is called from obverse #193

Open
jip opened this issue Apr 19, 2024 · 2 comments
Open

dbsig ignores x argument when is called from obverse #193

jip opened this issue Apr 19, 2024 · 2 comments

Comments

@jip
Copy link

jip commented Apr 19, 2024

Test script in ~temp/dbsig_bug.ijs:

f=: 3 : 0
  'custom error in f' 13!:8^:((0 e. ])`(12"_)) y
  'result of f'
)

g=: 3 : 0
  ' and g' ,~ f y
)

h=: (3 : 0) :. (3 : 0)
  ' and h^:_1' ,~ f y
)
  ' and h' ,~ f y
)

Demonstration:

   load '~temp/dbsig_bug.ijs'
   f 1
result of f
   f 0
|custom error in f: f
|   'custom error in f'    13!:8^:(((<(<,'3'),<(<(,'0');0),(<'e.'),<,']'),<(<,'"'),<(<(,'0');12),<(,'0');_))y
   g 1
result of f and g
   g 0
|custom error in f: f
|   'custom error in f'    13!:8^:(((<(<,'3'),<(<(,'0');0),(<'e.'),<,']'),<(<,'"'),<(<(,'0');12),<(,'0');_))y
   h 1
result of f and h
   h 0
|custom error in f: f
|   'custom error in f'    13!:8^:(((<(<,'3'),<(<(,'0');0),(<'e.'),<,']'),<(<,'"'),<(<(,'0');12),<(,'0');_))y
   h^:_1 (1)
result of f and h^:_1
   h^:_1 (0)
|assertion failure
|the result was expected to be all 1
|       h^:_1(0)

So, dbsig ignores x argument when is called from obverse, as the last assertion failure demonstrates.

Version strings:

   JVERSION
Engine: j9.6.0-beta5/j64/linux
Build: commercial/2024-04-11T16:59:56/clang-11-0-0/SLEEF=1
Library: 9.6.5
Platform: Linux 64
Installer: j9.6 install
InstallPath: /home/user/j9.6.0-beta5_j64
Contact: www.jsoftware.com
   JVERSION
Engine: j9.5.1/j64/linux
Build: commercial/2023-12-20T04:06:17/clang-11-0-0/SLEEF=1
Library: 9.5.5
Platform: Linux 64
Installer: j9.5 install
InstallPath: /home/user/j9.5.1_j64
Contact: www.jsoftware.com
`
@HenryHRich
Copy link
Contributor

HenryHRich commented Apr 19, 2024 via email

@jip
Copy link
Author

jip commented Apr 19, 2024

I guess no: f, g and h verbs in my demo are monads. When dbsig is called from monadic obverse, it ignores x argument supplied to dbsig. And it uses it when called from direct monadic invocation.

I've just found a simpler demo:

h=: (3 : 0) :. (3 : 0)
  'custom error in h^:_1' 13!:8^:((0 e. ])`(12"_)) y
  'result of h^:_1'
)
  'custom error in h' 13!:8^:((0 e. ])`(12"_)) y
  'result of h'
)

Demo:

   h 1
result of h
   h 0
|custom error in h: h
|   'custom error in h'    13!:8^:(((<(<,'3'),<(<(,'0');0),(<'e.'),<,']'),<(<,'"'),<(<(,'0');12),<(,'0');_))y
Press ENTER to inspect
   h^:_1 (1)
result of h^:_1
   h^:_1 (0)
|assertion failure
|the result was expected to be all 1
|       h^:_1(0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants