JohnEarnest / ok

An open-source interpreter for the K5 programming language.
MIT License
587 stars 72 forks source link

Manual says that $`beef returns "beef", but it returns "`beef" #45

Closed darkf closed 8 years ago

darkf commented 8 years ago

From oK:

$`beef
"`beef"

From the manual:

  $`beef
"beef"
darkf commented 8 years ago

This is because format gives a representation of symbols with the backtick, which is used in kfmt. "beef" seems to be the desired behavior (from kdb, anyway).

JohnEarnest commented 8 years ago

In K5:

 $`beef
"beef"

So, the behavior you expect should be what happens. The manual is right, oK's behavior is wrong.

JohnEarnest commented 8 years ago

As a side note, as mentioned in #8 I am not aware of a way to convert a string into a symbol; It's a little asymmetrical that you can still easily convert a symbol to an equivalent string. If any onlookers with a copy of k5 handy can find or point out a way to go the other way it may be a missing oK feature or at the least deserve a brief mention in the manual

ngn commented 8 years ago

There's an obvious way which already works in oK: ."",`

JohnEarnest commented 8 years ago

Good point, @ngn - constructing strings to eval is very flexible.