;;; -*-scheme-*- ;;; GNU Mes --- Maxwell Equations of Software ;;; Copyright © 2016,2017,2018 Jan (janneke) Nieuwenhuizen ;;; ;;; This file is part of GNU Mes. ;;; ;;; GNU Mes is free software; you can redistribute it and/or modify it ;;; under the terms of the GNU General Public License as published by ;;; the Free Software Foundation; either version 3 of the License, or (at ;;; your option) any later version. ;;; ;;; GNU Mes is distributed in the hope that it will be useful, but ;;; WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;; GNU General Public License for more details. ;;; ;;; You should have received a copy of the GNU General Public License ;;; along with GNU Mes. If not, see . ;;; Commentary: ;;; Implement core functionality that depends on implementation ;;; specifics of Mes cell types. ;;; Code: (define cell:type-alist (list (cons (quote )) (cons (quote )) (cons (quote )) (cons (quote )) (cons (quote )) (cons (quote )) (cons (quote )) (cons (quote )) (cons (quote )) (cons (quote )) (cons (quote )) (cons (quote )) (cons (quote )) (cons (quote )) (cons (quote )) (cons (quote )) (cons (quote )))) (define (cell:type-name x) (cond ((assq (core:type x) cell:type-alist) => cdr))) (define (bytes? x) (eq? (core:type x) )) (define (char? x) (and (eq? (core:type x) ) (> (char->integer x) -1))) (define (eof-object? x) (and (eq? (core:type x) ) (= (char->integer x) -1))) (define (closure? x) (eq? (core:type x) )) (define (continuation? x) (eq? (core:type x) )) (define (keyword? x) (eq? (core:type x) )) (define (macro? x) (eq? (core:type x) )) (define (number? x) (eq? (core:type x) )) (define (port? x) (eq? (core:type x) )) (define (procedure? p) (and (or (builtin? p) (and (pair? p) (eq? (car p) 'lambda)) (closure? p)) #t)) (define (special? x) (eq? (core:type x) )) (define (string? x) (eq? (core:type x) )) (define (struct? x) (eq? (core:type x) )) (define (symbol? x) (eq? (core:type x) )) (define (values? x) (eq? (core:type x) )) (define (variable? x) (eq? (core:type x) )) (define (variable-global? x) (core:cdr x)) (define (vector? x) (eq? (core:type x) )) (define (broken-heart? x) (eq? (core:type x) )) (define (atom? x) (not (pair? x))) (define (boolean? x) (or (eq? x #f) (eq? x #t))) ;;; core: accessors (define (string . lst) (list->string lst)) (define (keyword->list s) (string->list (keyword->string s))) (define (symbol->list s) (string->list (symbol->string s)))