« Fsharp » : différence entre les versions
De Banane Atomic
Aller à la navigationAller à la recherche
Aucun résumé des modifications |
|||
Ligne 6 : | Ligne 6 : | ||
dotnet new console -o fsharp1 -lang f# | dotnet new console -o fsharp1 -lang f# | ||
</kode> | </kode> | ||
= [https://learn.microsoft.com/fr-fr/dotnet/fsharp/language-reference/plaintext-formatting printf] = | |||
<kode lang='fs'> | |||
let s = "value" | |||
printfn "text %A text" s | |||
</kode> | |||
{| class="wikitable wtp wtmono1" | |||
! Format | |||
! Type | |||
|- | |||
| %A || any | |||
|- | |||
| %s || string | |||
|- | |||
| %i || integer | |||
|- | |||
| %b || boolean | |||
|} | |||
= Dev env = | = Dev env = |
Version du 24 septembre 2022 à 11:30
Command line
dotnet fsi # start F# Interactive dotnet fsi script.fsx # run script.fsx dotnet new console -o fsharp1 -lang f# |
printf
let s = "value" printfn "text %A text" s |
Format | Type |
---|---|
%A | any |
%s | string |
%i | integer |
%b | boolean |
Dev env
- VScode
- Ionide for F# extension
Create launch and tasks
- Disable the Ionide for F# extension
- Run → Run Without Debugging
- Select environment: .NET 5+ and .NET Core (this create the launch.json file)
- Open launch.json → Add Configuration → .NET: Launch .NET Core Console App
- Fill target-framework = net6.0 and project-name = myproject
- Run → Run Without Debugging
- Configure Task → Create tasks.json file from template → Select a Task Template: .NET Core