This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Evaluar expresiones simples usando los record definidos en SealedRecord. | |
// Se permite *, /, +, - con este nivel de precedencia. | |
// Las expresiones entre paréntesis se evalúan primero. | |
// | |
// op1 + op2 * op3 se evalúa como op1 + (op2*op3) | |
// op1 * op2 + op3 se evalúa como (op1*op2) + op3 | |
//package com.example.evaluar; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Strict On | |
Option Infer On | |
'Imports System | |
'Imports System.Windows.Forms | |
Imports System.Diagnostics | |
Imports System.Linq | |
Imports System.Xml | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// # novedadescs9_07 | |
// Crear un record partial | |
// Definir Deconstruct para los 3 argumentos | |
using System; | |
Console.WriteLine(@"Crear un record partial | |
Definir Deconstruct para los 3 argumentos | |
"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// # novedadescs9_07 | |
using System; | |
// Crear una nueva instancia de un tipo de registro (record) | |
var persona = new Persona("Guillermo", 1957); | |
// Mostrarerá todas las propiedades | |
Console.WriteLine($"persona: {persona}"); | |
//Console.WriteLine(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// # novedadescs9_06 | |
using System; | |
var persona = new Person() with {FirstName = "Guillermo", LastName = "Som"}; | |
Console.WriteLine($"persona: {persona}"); | |
var (f, l) = persona; | |
Console.WriteLine($"{f} {l}"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' # pruebaVB_07 | |
Option Strict On | |
Option Infer On | |
Imports System | |
Imports System.Text | |
Imports System.Reflection | |
Imports System.Collections.Generic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' # pruebaVB_06 | |
Option Strict On | |
Option Infer On | |
Imports System | |
Imports System.Text | |
Imports System.Reflection | |
Imports System.Collections.Generic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' # ejemplo 1 | |
Imports System | |
Module Program | |
Sub Main(args As String()) | |
Console.WriteLine("Hello World!") | |
dim persona1 = New Persona With { .Nombre = "Guillermo", .Edad = 63 } | |
'Console.WriteLine($"persona1: {persona1.Nombre} {persona1.Edad}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
var persona = new Persona("Guillermo", 63); | |
Console.WriteLine("La persona: {0}.", persona); | |
var (n, e) = persona; | |
Console.WriteLine($"{n} {e}"); | |
public record Persona(string Nombre, int Edad); |
NewerOlder