<!DOCTYPE HTML>
<html lang="es" class="light sidebar-visible" dir="ltr">
<head>
<!-- Book generated using mdBook -->
<meta charset="UTF-8">
<title>pharo - Portafolio Web de Thomas</title>
<!-- Custom HTML head -->
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="theme-color" content="#ffffff">
<link rel="icon" href="../../favicon.svg">
<link rel="shortcut icon" href="../../favicon.png">
<link rel="stylesheet" href="../../css/variables.css">
<link rel="stylesheet" href="../../css/general.css">
<link rel="stylesheet" href="../../css/chrome.css">
<link rel="stylesheet" href="../../css/print.css" media="print">
<!-- Fonts -->
<link rel="stylesheet" href="../../FontAwesome/css/font-awesome.css">
<link rel="stylesheet" href="../../fonts/fonts.css">
<!-- Highlight.js Stylesheets -->
<link rel="stylesheet" href="../../highlight.css">
<link rel="stylesheet" href="../../tomorrow-night.css">
<link rel="stylesheet" href="../../ayu-highlight.css">
<!-- Custom theme stylesheets -->
<!-- Provide site root to javascript -->
<script>
var path_to_root = "../../";
var default_theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "navy" : "light";
</script>
<!-- Start loading toc.js asap -->
<script src="../../toc.js"></script>
</head>
<body>
<div id="body-container">
<!-- Work around some values being stored in localStorage wrapped in quotes -->
<script>
try {
var theme = localStorage.getItem('mdbook-theme');
var sidebar = localStorage.getItem('mdbook-sidebar');
if (theme.startsWith('"') && theme.endsWith('"')) {
localStorage.setItem('mdbook-theme', theme.slice(1, theme.length - 1));
}
if (sidebar.startsWith('"') && sidebar.endsWith('"')) {
localStorage.setItem('mdbook-sidebar', sidebar.slice(1, sidebar.length - 1));
}
} catch (e) { }
</script>
<!-- Set the theme before any content is loaded, prevents flash -->
<script>
var theme;
try { theme = localStorage.getItem('mdbook-theme'); } catch(e) { }
if (theme === null || theme === undefined) { theme = default_theme; }
const html = document.documentElement;
html.classList.remove('light')
html.classList.add(theme);
html.classList.add("js");
</script>
<input type="checkbox" id="sidebar-toggle-anchor" class="hidden">
<!-- Hide / unhide sidebar before it is displayed -->
<script>
var sidebar = null;
var sidebar_toggle = document.getElementById("sidebar-toggle-anchor");
if (document.body.clientWidth >= 1080) {
try { sidebar = localStorage.getItem('mdbook-sidebar'); } catch(e) { }
sidebar = sidebar || 'visible';
} else {
sidebar = 'hidden';
}
sidebar_toggle.checked = sidebar === 'visible';
html.classList.remove('sidebar-visible');
html.classList.add("sidebar-" + sidebar);
</script>
<nav id="sidebar" class="sidebar" aria-label="Table of contents">
<!-- populated by js -->
<mdbook-sidebar-scrollbox class="sidebar-scrollbox"></mdbook-sidebar-scrollbox>
<noscript>
<iframe class="sidebar-iframe-outer" src="../../toc.html"></iframe>
</noscript>
<div id="sidebar-resize-handle" class="sidebar-resize-handle">
<div class="sidebar-resize-indicator"></div>
</div>
</nav>
<div id="page-wrapper" class="page-wrapper">
<div class="page">
<div id="menu-bar-hover-placeholder"></div>
<div id="menu-bar" class="menu-bar sticky">
<div class="left-buttons">
<label id="sidebar-toggle" class="icon-button" for="sidebar-toggle-anchor" title="Toggle Table of Contents" aria-label="Toggle Table of Contents" aria-controls="sidebar">
<i class="fa fa-bars"></i>
</label>
<button id="theme-toggle" class="icon-button" type="button" title="Change theme" aria-label="Change theme" aria-haspopup="true" aria-expanded="false" aria-controls="theme-list">
<i class="fa fa-paint-brush"></i>
</button>
<ul id="theme-list" class="theme-popup" aria-label="Themes" role="menu">
<li role="none"><button role="menuitem" class="theme" id="light">Light</button></li>
<li role="none"><button role="menuitem" class="theme" id="rust">Rust</button></li>
<li role="none"><button role="menuitem" class="theme" id="coal">Coal</button></li>
<li role="none"><button role="menuitem" class="theme" id="navy">Navy</button></li>
<li role="none"><button role="menuitem" class="theme" id="ayu">Ayu</button></li>
</ul>
<button id="search-toggle" class="icon-button" type="button" title="Search. (Shortkey: s)" aria-label="Toggle Searchbar" aria-expanded="false" aria-keyshortcuts="S" aria-controls="searchbar">
<i class="fa fa-search"></i>
</button>
</div>
<h1 class="menu-title">Portafolio Web de Thomas</h1>
<div class="right-buttons">
<a href="../../print.html" title="Print this book" aria-label="Print this book">
<i id="print-button" class="fa fa-print"></i>
</a>
</div>
</div>
<div id="search-wrapper" class="hidden">
<form id="searchbar-outer" class="searchbar-outer">
<input type="search" id="searchbar" name="searchbar" placeholder="Search this book ..." aria-controls="searchresults-outer" aria-describedby="searchresults-header">
</form>
<div id="searchresults-outer" class="searchresults-outer hidden">
<div id="searchresults-header" class="searchresults-header"></div>
<ul id="searchresults">
</ul>
</div>
</div>
<!-- Apply ARIA attributes after the sidebar and the sidebar toggle button are added to the DOM -->
<script>
document.getElementById('sidebar-toggle').setAttribute('aria-expanded', sidebar === 'visible');
document.getElementById('sidebar').setAttribute('aria-hidden', sidebar !== 'visible');
Array.from(document.querySelectorAll('#sidebar a')).forEach(function(link) {
link.setAttribute('tabIndex', sidebar === 'visible' ? 0 : -1);
});
</script>
<div id="content" class="content">
<main>
<h1 id="lectura-anotada-pharo"><a class="header" href="#lectura-anotada-pharo">Lectura anotada pharo</a></h1>
<!--@meta
---
breaks: false
Autor: Thomas Martínez Sánchez
tags: Unidades Semánticas
---
-->
<h2 id="lectura-anotada-de-pharo"><a class="header" href="#lectura-anotada-de-pharo">Lectura anotada de Pharo</a></h2>
<h3 id="representando-y-procesando-datos-en-pharo"><a class="header" href="#representando-y-procesando-datos-en-pharo">Representando y procesando datos en Pharo</a></h3>
<p>"en el capítulo 1: ¿todo en Pharo es objeto? ¿hasta los números? ¿y los errores existenciales también son objetos o qué?"</p>
<p>"--- Números ---"
3 + 4. "en el capítulo 1: esto da 7. Ok, sí, pero... ¿por qué parece que 3 le está mandando una carta al 4? ¿esto es OOP en esteroides?"</p>
<p>10 - 2. "en el capítulo 1: resta normal, cero emoción."
5 * 2. "en el capítulo 1: esto da 10. matemáticas básicas funcionando como siempre."
20 / 4. "en el capítulo 1: da 5.0. ¿por qué no 5 a secas? Ah, porque ya están metiendo floats sin permiso..."</p>
<p>"--- Strings ---"
'Hola mundo'. "en el capítulo 2: ¿comillas simples para los strings? raro, pero bueno."</p>
<p>'Hola' , ' mundo'. "en el capítulo 2: ¿coma para concatenar? Qué poético."</p>
<p>'Pharo' class. "en el capítulo 2: esto devuelve 'String'. obvio, pero igual necesitaba comprobarlo porque uno nunca sabe..."</p>
<p>"--- Colecciones ---"</p>
<h1 id="1-2-3--en-el-capítulo-3-esto-es-un-array-fijo-pa-qué-me-sirve-si-no-lo-puedo-cambiar"><a class="header" href="#1-2-3--en-el-capítulo-3-esto-es-un-array-fijo-pa-qué-me-sirve-si-no-lo-puedo-cambiar">(1 2 3). "en el capítulo 3: esto es un array fijo. ¿pa’ qué me sirve si no lo puedo cambiar?"</a></h1>
<p>Array with: 1 with: 2 with: 3. "en el capítulo 3: ahora sí, esto es más usable. gracias."</p>
<h1 id="1-2-3-at-2--en-el-capítulo-3-esto-da-2-pero-por-qué-los-índices-empiezan-en-1-quién-decidió-esto"><a class="header" href="#1-2-3-at-2--en-el-capítulo-3-esto-da-2-pero-por-qué-los-índices-empiezan-en-1-quién-decidió-esto">(1 2 3) at: 2. "en el capítulo 3: esto da 2. Pero... ¿por qué los índices empiezan en 1? ¿¡quién decidió esto!?"</a></h1>
<p>"--- Diccionario ---"
dict := Dictionary new. "en el capítulo 4: ok, diccionario creado. listo pa' chismear."</p>
<p>dict at: 'nombre' put: 'Thomas'. "en el capítulo 4: agregué 'nombre'. soy yo."
dict at: 'edad' put: 24. "y obvio, la edad también. bastante autorreferencial este ejercicio."</p>
<p>dict at: 'nombre'. "en el capítulo 4: esto devuelve 'Thomas'. si no, algo explotó."</p>
<p>"--- Clases ---"
"en el capítulo 5: hora de sentirme poderoso. vamos a crear una clase llamada Persona."</p>
<p>Object subclass: #Persona
instanceVariableNames: 'nombre edad'. "tiene lo básico para existir: nombre y edad. con eso me basta."</p>
<p>p := Persona new. "en el capítulo 5: creé una persona. básicamente Dios."</p>
<p>p instVarNamed: 'nombre' put: 'Thomas'. "le metí el nombre. igualito a mí."
p instVarNamed: 'edad' put: 24. "la edad también. seguimos clonándome."</p>
<p>p inspect. "en el capítulo 5: el inspector me deja ver por dentro a mi creación. medio creepy, medio cool."</p>
</main>
<nav class="nav-wrapper" aria-label="Page navigation">
<!-- Mobile navigation buttons -->
<a rel="prev" href="../../unisemanticas/corte/paradigmas.html" class="mobile-nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
<i class="fa fa-angle-left"></i>
</a>
<a rel="next prefetch" href="../../unisemanticas/corte/jsonypokemones.html" class="mobile-nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
<i class="fa fa-angle-right"></i>
</a>
<div style="clear: both"></div>
</nav>
</div>
</div>
<nav class="nav-wide-wrapper" aria-label="Page navigation">
<a rel="prev" href="../../unisemanticas/corte/paradigmas.html" class="nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
<i class="fa fa-angle-left"></i>
</a>
<a rel="next prefetch" href="../../unisemanticas/corte/jsonypokemones.html" class="nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
<i class="fa fa-angle-right"></i>
</a>
</nav>
</div>
<!-- Livereload script (if served using the cli tool) -->
<script>
const wsProtocol = location.protocol === 'https:' ? 'wss:' : 'ws:';
const wsAddress = wsProtocol + "//" + location.host + "/" + "__livereload";
const socket = new WebSocket(wsAddress);
socket.onmessage = function (event) {
if (event.data === "reload") {
socket.close();
location.reload();
}
};
window.onbeforeunload = function() {
socket.close();
}
</script>
<script>
window.playground_copyable = true;
</script>
<script src="../../elasticlunr.min.js"></script>
<script src="../../mark.min.js"></script>
<script src="../../searcher.js"></script>
<script src="../../clipboard.min.js"></script>
<script src="../../highlight.js"></script>
<script src="../../book.js"></script>
<!-- Custom JS scripts -->
</div>
</body>
</html>