microsoft / microsoft/Power-Fx
REPL echo output is poorly formed
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 3.4k
- Forks
- 358
- Avg merge
- 10h 34m
- Merged PRs (30d)
- 3
Description
Here was the input script:
Word = "hello"
Set( Guess, "howdy" )
Result = Concat( Sequence(5),
If( Mid(Guess,Value,1) = Mid(Word,Value,1), "🟩",
Mid(Guess,Value,1) in Word And Len(Guess) >= Value, "🟨",
"⬜"
)
)
Set( Guess, "taser" )
Set( Guess, "flick" )
Set( Guess, "howdy" )
Set( Guess, "hello" )
which resulted in this output with the PAC CLI with --echo (which passes echo into the REPL library). Notice that the newline is between the line that was executed and the output, and no newline between the output and the next command. Also no prompt is included which would explain what was going on, similar to running in interactive mode.
Word = "hello"
Word: "hello"
Set( Guess, "howdy" )
Guess: "howdy"
true
Result = Concat( Sequence(5),
If( Mid(Guess,Value,1) = Mid(Word,Value,1), "🟩",
Mid(Guess,Value,1) in Word And Len(Guess) >= Value, "🟨",
"⬜"
)
)
Result: "🟩🟨⬜⬜⬜"
Set( Guess, "taser" )
Result: "⬜⬜⬜🟨⬜"
Guess: "taser"
true
Set( Guess, "flick" )
Result: "⬜🟨⬜⬜⬜"
Guess: "flick"
true
Set( Guess, "howdy" )
Result: "🟩🟨⬜⬜⬜"
Guess: "howdy"
true
Set( Guess, "hello" )
Result: "🟩🟩🟩🟩🟩"
Guess: "hello"
true
This would be better as:
>> Word = "hello"
Word: "hello"
>> Set( Guess, "howdy" )
Guess: "howdy"
true
>> Result = Concat( Sequence(5),
.. If( Mid(Guess,Value,1) = Mid(Word,Value,1), "🟩",
.. Mid(Guess,Value,1) in Word And Len(Guess) >= Value, "🟨",
.. "⬜"
.. )
..)
Result: "🟩🟨⬜⬜⬜"
>> Set( Guess, "taser" )
Result: "⬜⬜⬜🟨⬜"
Guess: "taser"
true
>> Set( Guess, "flick" )
Result: "⬜🟨⬜⬜⬜"
Guess: "flick"
true
>> Set( Guess, "howdy" )
Result: "🟩🟨⬜⬜⬜"
Guess: "howdy"
true
>> Set( Guess, "hello" )
Result: "🟩🟩🟩🟩🟩"
Guess: "hello"
true
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing how the PAC CLI's --echo option passes input into the REPL library and how commands and results are rendered. Compare the current transcript with the requested example; done means prompts, continuation markers, and blank lines clearly separate each command from its output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- cli, developer-experience
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100