Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 04:52
    cston edited #52192
  • 03:44
    msftbot[bot] milestoned #55363
  • 03:44

    davidwengier on main

    Make dynamic path map case inseā€¦ (compare)

  • 03:44
    davidwengier closed #55363
  • 03:44
    davidwengier closed #55362
  • 03:42
    CyrusNajmabadi synchronize #55426
  • 03:34
    CyrusNajmabadi synchronize #55426
  • 03:32
    CyrusNajmabadi synchronize #55426
  • 03:29
    ryzngard synchronize #55424
  • 03:02

    dotnet-bot on release

    (compare)

  • 03:02

    dotnet-bot on release

    (compare)

  • 03:01

    dotnet-bot on release

    (compare)

  • 03:01

    dotnet-bot on release

    (compare)

  • 03:01

    dotnet-bot on release

    (compare)

  • 03:01

    dotnet-bot on release

    (compare)

  • 03:01

    dotnet-bot on main-vs-deps-to-release

    (compare)

  • 03:01

    dotnet-bot on main-vs-deps-to-release

    (compare)

  • 03:01

    dotnet-bot on release

    (compare)

  • 03:01

    dotnet-bot on release

    (compare)

  • 03:01

    dotnet-bot on release

    (compare)

Joseph Musser
@jnm2
You wouldn't use < to improve readability when looking at source. < is only readable when rendered.
Antony Male
@canton7
I think I've spent so long looking at HTML, that stuff looks normal. All I see is blond, brunette, redhead
Joseph Musser
@jnm2
Sure, but there's only one place I'm reading C# code and there's XML escapes in it :D
Anyway, I'll start a source package library over TextWriter if I get into source generators, I think
Unless someone else has one
Bernd Baumanns
@bernd5
that would be great
Joseph Musser
@jnm2
@bernd5 I'd ask to take your code and refactor it away from SyntaxNode
If I get there
Bernd Baumanns
@bernd5
ok
my code is built on top of SymbolVisitor
Joseph Musser
@jnm2
The primary output for a source generator writer is either string or SourceText, right?
Bernd Baumanns
@bernd5
but dispatching manually works, too
Joseph Musser
@jnm2
Maybe instead of TextWriter it should be StringBuilder or SourceTextBuilder.
Bernd Baumanns
@bernd5
isn't TextWriter a StringBuilder-Wrapper?
Joseph Musser
@jnm2
It is.
Well, StringWriter is.
TextWriter can be buffered file IO, network IO, etc
Console.Out is a TextWriter instance
Bernd Baumanns
@bernd5
yes
Joseph Musser
@jnm2
The only advantage to TextWriter would be if you wanted to stream out results somewhere besides giving the result to Roslyn.
Guess it could make the library useful when generating source not as a Roslyn source generator.
Anyway, I don't have a SG idea right now, so who knows if I will ever do anything.
Antony Male
@canton7
The Sharp Ninja
@sharpninja
Hello, how do I add a semicolon token to a VariableDeclarationSyntax?
Bernd Baumanns
@bernd5
A VariableDeclarationSyntax has no semicolon
But you can wrap it for example in a LocalDeclarationStatementSyntax
Good way to get in touch with roslyns syntax trees is: https://roslynquoter.azurewebsites.net/
ShannonZ
@ShannonZ
Is it possible to generate a function according to an user-input math formula (string)?
CyrusNajmabadi
@CyrusNajmabadi
what do you mean?
ShannonZ
@ShannonZ
I want to make a curve fitting app. In my situation, there are two double array double[] x double[] y. The fitting model is user-input. One may input y = f(x) = a*x+b, y = f(x)=a*x^2+b*x+c. The fitting engine provide a interface cftool(double[] x, double[] y, delegate model, double[] parameters). My question is how to convert y = a*x+b to a delegate or a function?
CyrusNajmabadi
@CyrusNajmabadi
parse it, and generate the corresponding code?
are you asking how to write a compiler in general?
ShannonZ
@ShannonZ
I've got the string y = k*x+b, I want to know how to generate a function vec LinearModel(vec x, vec param) {return param[0]*x + param[1]}
CyrusNajmabadi
@CyrusNajmabadi
what do you mean by "how" :)
this looks to be yoru own language
let me put it this way.
if you were to explain to me in english what should happen here, how would you go about doing it?
and once you ahve the english description for what to do, what is stopping you from then implementing that english with code?
ShannonZ
@ShannonZ
CyrusNajmabadi
@CyrusNajmabadi
that's a video :)
let me ask a clearer question:
are you asking how to write a compiler?
or are you just trying to write a simple converter that takes in one expression and spits out another?
ShannonZ
@ShannonZ
a simple converter
CyrusNajmabadi
@CyrusNajmabadi
ok. so if you jsut want a simpelr converter, just parse teh expression into a syntax tree of some form you define
tehn walk that tree, spitting out the new code you want
ShannonZ
@ShannonZ
thx
Yair Halberstadt
@YairHalberstadt
How do I check if a Type symbol is dynamic?
Yair Halberstadt
@YairHalberstadt
IDynamicTypeSymbol