user-documentation
user-documentation copied to clipboard
Added examples for Dict\fill_keys and Dict\from_values
Passed all tests by running ./vendor/bin/hacktest tests/:
Summary: 5102 test(s), 5102 passed, 0 failed, 0 skipped, 0 error(s).
Would you like to replace print_r with an HSL function?
Would you like to replace
print_rwith an HSL function?
Hey Atry, thanks a lot. I'd love to, but I wasn't able to find an appropriate HSL function for printing dictionaries. Echo also doesn't work. Would it be possible to help me with this. Many many thanks!
https://docs.hhvm.com/hsl/reference/function/HH.Lib.IO.request_output/
Yaxin Lei @.***>于2022年10月15日 周六下午9:37写道:
Would you like to replace print_r with an HSL function?
Hey Astry, thanks a lot. I'd love to, but I wasn't able to find an appropriate HSL function for printing dictionaries. Echo also doesn't work. Would it be possible to help me with this. Many many thanks!
— Reply to this email directly, view it on GitHub https://github.com/hhvm/user-documentation/pull/1300#issuecomment-1279889922, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAES3OVKTIRVW4JIGI3WHJDWDOA65ANCNFSM6AAAAAAREY2Z3A . You are receiving this because you commented.Message ID: @.***>
Thank you so much for your help! Would the following be the right way to use it as IO\request_output also doesn't have too many documentations.
$values = vec[1, 2, 3, 4];
$dict = Dict\from_values($values, $x ==> $x + 1);
IO\request_output($dict);
I was trying to learn from previous examples and I found both Dict.select_keys and Dict.groupby were using print_r in the existing documentation: https://github.com/hhvm/user-documentation/blob/main/api-examples/function.HH.Lib.Dict.select_keys.md
https://docs.hhvm.com/hsl/reference/function/HH.Lib.IO.request_output/ Yaxin Lei @.>于2022年10月15日 周六下午9:37写道: … Would you like to replace print_r with an HSL function? Hey Astry, thanks a lot. I'd love to, but I wasn't able to find an appropriate HSL function for printing dictionaries. Echo also doesn't work. Would it be possible to help me with this. Many many thanks! — Reply to this email directly, view it on GitHub <#1300 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAES3OVKTIRVW4JIGI3WHJDWDOA65ANCNFSM6AAAAAAREY2Z3A . You are receiving this because you commented
.Message ID: @.>
All tests passed locally, and the webpage also looks fine.
https://docs.hhvm.com/hsl/reference/function/HH.Lib.IO.request_output/ Yaxin Lei @.>于2022年10月15日 周六下午9:37写道: … Would you like to replace print_r with an HSL function? Hey Astry, thanks a lot. I'd love to, but I wasn't able to find an appropriate HSL function for printing dictionaries. Echo also doesn't work. Would it be possible to help me with this. Many many thanks! — Reply to this email directly, view it on GitHub <#1300 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAES3OVKTIRVW4JIGI3WHJDWDOA65ANCNFSM6AAAAAAREY2Z3A . You are receiving this because you commented.Message ID: @.>
All local tests and builds looks fine.
https://docs.hhvm.com/hsl/reference/function/HH.Lib.IO.request_output/ Yaxin Lei @.>于2022年10月15日 周六下午9:37写道: … Would you like to replace print_r with an HSL function? Hey Astry, thanks a lot. I'd love to, but I wasn't able to find an appropriate HSL function for printing dictionaries. Echo also doesn't work. Would it be possible to help me with this. Many many thanks! — Reply to this email directly, view it on GitHub <#1300 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAES3OVKTIRVW4JIGI3WHJDWDOA65ANCNFSM6AAAAAAREY2Z3A . You are receiving this because you commented.Message ID: @.>
When I switched to request_output, and ran the following in the vscode debugger, nothing was given as output. And when I ran build, and looked at the website in through the server, it looked like the below. It would be awesome if you can provide some help, many thanks!

See https://docs.hhvm.com/hack/getting-started/input-and-output for basic usage of request_output.
.Message ID: @.>