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

Correct file suffix for K data as K files #636

Open
tavmem opened this issue Nov 3, 2022 · 1 comment
Open

Correct file suffix for K data as K files #636

tavmem opened this issue Nov 3, 2022 · 1 comment
Labels
incompatibility result is different than k2.8 or k3.2

Comments

@tavmem
Copy link
Collaborator

tavmem commented Nov 3, 2022

When using the command "file" 1: ("a"; 4 5):

  • k2.8 on Linux creates "file.l"
  • k3.2 on Windows also creates "file.l"

Kona

  • on Linux creates "file.l"
  • on Windows creates "file.K"
  • on OSX creates "file.l"

However, the K Reference Manual states:

Load/Save K Data as K Files

1: f
f 1: x

Arguments
The argument f is a symbol atom or character vector, while x is any atom or list. In
the first case, Load K Data (monadic 1:), f may also be a character atom.
Definition
In either case f holds the name of a file, including any directory path information.
The monadic function 1: f loads that file into the workspace as a data object,
which is the result of the function. The dyadic function f 1: x saves the data x
in a file in the format of a K data object. Presumably the monadic function is
applied to a file that has been previously created with the dyadic function.

Note: The actual name of the file referred to by f may differ from the name held in
f, typically by the extent .K on Unix systems and by .L on NT. For example, if f
is "/dir/prices" then the actual file name would be /dir/prices.K on
Unix, or /dir/prices.L on NT. The full file name including the suffix is per-
mitted for f, but is not portable.

All implementations (k2.8, k3.2 and kona) are currently incompatible with the K Reference Manual
Note, that there is a "TODO" in the kona source file src/0.c

K _1d(K x,K y) {
  I t=x->t;
  if(4==t || -3==t){
    S m=CSK(x); I sm = strlen(m);
    S e= sm > 1 && '.'==m[sm-2] && *KFX==m[sm-1] ? strdupn(m,sm) : glueSS(m,KFX);
    //TODO: lfop (lower-case l on Windows -- differs from 'L' in manual)

Which is the best way to go?

@tavmem tavmem added the incompatibility result is different than k2.8 or k3.2 label Nov 3, 2022
@bakul
Copy link
Contributor

bakul commented Nov 3, 2022

k3.2 uses .l extension under linux. I think this is better for a data file. .k or .K should be used for K source code files (in ascii).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
incompatibility result is different than k2.8 or k3.2
Projects
None yet
Development

No branches or pull requests

2 participants