From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 102395 invoked by alias); 28 Dec 2016 05:38:52 -0000 Mailing-List: contact kawa-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: kawa-owner@sourceware.org Received: (qmail 102220 invoked by uid 89); 28 Dec 2016 05:38:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=sk:java.la, sk:javala, Christmas, christmas X-HELO: mail-qt0-f171.google.com Received: from mail-qt0-f171.google.com (HELO mail-qt0-f171.google.com) (209.85.216.171) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 28 Dec 2016 05:35:14 +0000 Received: by mail-qt0-f171.google.com with SMTP id p16so339953991qta.0 for ; Tue, 27 Dec 2016 21:35:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=EWbLeAFzu6x6HAiOxCy1mBcU18tKZJx0zDJerdf/wpU=; b=mxMarfaFyIXd3uPJouHMqeUmnc9UxnBZhallPDlPmkm1YRb1310EKsMy5BMwNVJ9/U PWEpgKCZYX75hbUrfVOShm/r/kMbkYaTNmPkai718n82PHHflEwu4jfrprS35jwpxp7U SvK18Sbbp6PgoK6/RKgZE8vKFSx4ngorZR6j+jPS718pZ//Z36tmjjxiI6iEVCMbxg6H 0ZlmtTbP10qutrUDqYKTDiVxpXvMi26A2Q/6VNIEeKMkOx/wHDimNpi02L5Efvtra7C2 wGWtRhVKZO2dv3nQoBlagfqVqqPqecOdGYe7c1qqha95z4nLPeP41sWNRM9wEFZy+2me 5vww== X-Gm-Message-State: AIkVDXLHYZm6K8SIJfaMwCEelS/Gfn9shbMzZKJ731vBoQiYJmPobcQNVux9z5Kj6STLVZW4rlo8lfmIU2pT0A== X-Received: by 10.200.53.243 with SMTP id l48mr26276947qtb.193.1482903312159; Tue, 27 Dec 2016 21:35:12 -0800 (PST) MIME-Version: 1.0 Received: by 10.140.88.243 with HTTP; Tue, 27 Dec 2016 21:34:31 -0800 (PST) From: Duncan Mak Date: Wed, 28 Dec 2016 05:38:00 -0000 Message-ID: Subject: Reflection on function argument types To: kawa mailing list Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2016-q4/txt/msg00086.txt.bz2 Hello all, Happy holidays! I'm playing around with Kawa over Christmas break to learn more how functions are represented in the system. I wrote the following code: (import (srfi 1)) (define (foo (a :: integer)) (+ a a)) (define (hello-number (n :: number) (i :: number)) (list "number" n)) (define (hello-string (s :: string)) (list "string" s)) (define (print-types (func :: gnu.mapping.MethodProc)) (display (procedure-property func 'name)) (newline) (for-each (lambda (t) (display t) (newline)) (map (lambda (i) (func:getParameterType i)) (iota (func:numParameters)))) (newline)) (print-types foo) (print-types hello-number) (print-types hello-string) I'm surprise to see that the output differs between foo and hello-*: foo Type integer hello-number ClassType java.lang.Object ClassType java.lang.Object hello-string ClassType java.lang.Object Why is it that I only see java.lang.Object for the hello-* functions? Shouldn't number and string show up, like it did for foo? Thanks! -- Duncan.