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

sub-shells handled inconsistently inside object builders #853

Closed
lmorg opened this issue Aug 4, 2024 · 0 comments · Fixed by #849
Closed

sub-shells handled inconsistently inside object builders #853

lmorg opened this issue Aug 4, 2024 · 0 comments · Fixed by #849
Labels
bug Unexpected behavior deployed to `develop` Feature built. Currently BETA testing in the `develop` branch

Comments

@lmorg
Copy link
Owner

lmorg commented Aug 4, 2024

Describe the bug:
An object of a variable inside an object would return a nested object. eg

murex » bob = %{a:1, b:2, c:3}
murex » %{hello: $bob}
{
    "hello": {
        "a": 1,
        "b": 2,
        "c": 3
    }
}

However a sub-shell inside an object always returns a string.

murex » function bob { %{a:1, b:2, c:3}}
murex » %{hello: ${bob}}
{
    "hello": "{\"a\":1,\"b\":2,\"c\":3}"
}

Despite that sub-shell returning a structured data type:

murex » bob -> debug -> [Data-Type]
{
    "Go": "map[string]interface {}",
    "Murex": "json",
    "UnmarshalData Err": "\u003cnil\u003e"
}

As an aside, C-style functions are also not handled consistently:

murex » %{hello: bob())}
{
    "hello": "bob())"
}

but that can be treated as a separate feature request.

Expected behaviour:

${} should be parsed as parsed as an object like variables are.

Platform (please complete the following information):

  • OS, output from uname -a if supported: macOS
  • Terminal Emulator: iTerm2
  • Murex version, output from version --no-app-name: latest

Additional context
N/A

@lmorg lmorg added the bug Unexpected behavior label Aug 4, 2024
@lmorg lmorg added the deployed to `develop` Feature built. Currently BETA testing in the `develop` branch label Aug 4, 2024
@lmorg lmorg linked a pull request Aug 11, 2024 that will close this issue
@lmorg lmorg mentioned this issue Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unexpected behavior deployed to `develop` Feature built. Currently BETA testing in the `develop` branch
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant