microsoft / microsoft/Power-Fx

REPL echo output is poorly formed

Open
#1,941 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

REPL
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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.