Skip to content

Instantly share code, notes, and snippets.

View crowl's full-sized avatar

Pablo Heredia crowl

  • Vacasa
  • Santiago, Chile
View GitHub Profile
// PARA TI MARTÍN c:
#include <stdlib.h>
#include <stdio.h>
struct abb {
int valor;
struct abb *izq, *der;
};
;;; P10 - Evaluación Matemática
(define mateval
(lambda (expr)
(cond
((number? expr) expr)
(else
(cond
((eqv? 'ADD (car expr)) (+
(mateval (cadr expr))
@crowl
crowl / p9.scm
Created December 15, 2015 17:37
;;; P9 - Inserción de Strings en Listas
(define compare-lex
(lambda (a b)
(string-ci<? (substring a 0 1) (substring b 0 1))))
(define insert
(lambda (strlst lst)
(letrec ((combine (lambda (a b)
(cond
@crowl
crowl / p5.scm
Created December 15, 2015 05:32
(define sucesioncola
(lambda (n)
(letrec ([sc-do (lambda (a b c count)
(cond
((= count 0) c)
(else
(sc-do (+ a c) a b (- count 1)))))])
(cond
((< n 3) n)
(else (sc-do 2 1 0 n))))
@crowl
crowl / p2.scm
Created December 15, 2015 03:16
;;; p2.scm
(define codificador
(lambda (c e)
(cond
((null? e) '())
((not (assq (car e) c)) (cons (car e) (codificador c (cdr e))))
(else (cons (cdr (assq (car e) c)) (codificador c (cdr e)))))))
;;; Prueba
@crowl
crowl / p7.scm
Created December 15, 2015 02:51
(define once
(let ((called #f))
(lambda (f)
(lambda args
(cond
((not called)
(set! called #t)
(apply f args))
(else args))))))
@crowl
crowl / stops.geojson
Last active November 11, 2015 04:20
tstgo
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@crowl
crowl / NSDictionary+NSNullUtility.h
Created July 13, 2012 03:06
NSDictionary category to deal with nil instead of NSNull objects created by NSJSONSerialization
//
// NSDictionary+NSNullUtility.h
//
//
// Created by Pablo Heredia on 12-07-12.
// Copyright (c) 2012. All rights reserved.
//
#import <Foundation/Foundation.h>