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
;; -*- coding: utf-8; mode: scheme -*- | |
;; $Id: num-roman.rkt,v 1.14 2012/02/16 04:02:35 alcides_fp Exp $ | |
#lang racket | |
(provide numeral) | |
(define (numeral digito posicion) | |
(let ((matriz-numerales | |
#(#("" "I" "II" "III" "IV" "V" "VI" "VII" "VIII" "IX") | |
#("" "X" "XX" "XXX" "XL" "L" "LX" "LXX" "LXXX" "XC") |
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
;; -*- coding:utf-8; mode:Scheme -*- | |
#lang racket | |
(require rackunit | |
rackunit/text-ui | |
"numero-lcd.rkt") | |
(define-test-suite numero-lcd-suite | |
(test-case |
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
;; -*- coding:utf-8; mode:Scheme -*- | |
#lang racket | |
(provide num->lcd) | |
(define cadenas #((string-append " - \n" | |
"| |\n" | |
" \n" | |
"| |\n" | |
" - \n") ;;0 |
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
// -*- coding:utf-8; -*- | |
import java.awt.event.*; | |
import java.awt.BorderLayout; | |
import javax.swing.*; | |
/* Demuestra el uso de clases Swing en Java */ | |
public class SimpleFrame extends JFrame { | |
public JLabel label; |
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
#! /usr/bin/env jruby | |
# -*- coding:utf-8; -*- | |
'Demuestra el uso de clases Java Swing en JRuby' | |
require 'java' | |
#========================================================================= | |
class SimpleFrame < javax.swing.JFrame |
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
#! /usr/bin/env jython | |
#-*- coding: utf-8; mode: Jython -*- | |
"Demuestra el uso de clases Java Swing en Jython" | |
from java.awt import BorderLayout | |
from javax import swing | |
#========================================================================= | |
class SimpleFrame(swing.JFrame): |
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
;; -*- coding:utf-8; mode:Scheme -*- | |
"Shows howto use Java Swing classes in Kawa Scheme" | |
(define-alias JLabel javax.swing.JLabel) | |
(define-alias JButton javax.swing.JButton) | |
;;======================================================================== | |
(define-simple-class SimpleFrame (javax.swing.JFrame) | |
;; members |
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
(ns demo1 (:import (javax.swing JFrame JLabel))) | |
(doto (JFrame. "Hello") | |
(.add (JLabel. "Hello, World!")) | |
(.pack) | |
(.setDefaultCloseOperation JFrame/EXIT_ON_CLOSE) | |
(.setVisible true)) |
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
(define-alias JFrame javax.swing.JFrame) | |
(let ((f (JFrame "Hola"))) | |
(f:add (javax.swing.JLabel "¡Hola a todos!")) | |
(f:pack) | |
(f:setDefaultCloseOperation JFrame:EXIT_ON_CLOSE) | |
(f:setVisible #t)) |
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
;; -*- coding:utf-8; mode:Scheme -*- | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
(define-simple-class Person () | |
;; members | |
(name init: "" ) | |
(birth-year init: 0 ) | |
;; methods | |
((*init*) #!void) ;; default constructor | |
((*init* name: birth-year:) ;; constructor with params |
OlderNewer