Welcome to the CHICKEN Scheme pasting service

no title added by alice on Mon Jul 29 02:56:26 2019

; record-test.scm
(module record-test ()

(import scheme)
(import chicken.base)
(import chicken.type)
(import chicken.format)
(import chicken.memory.representation)

(import types)

(define x (make-r 1 "alice"))
(printf "r?: ~A\nr-def?: ~A\nr-def-lam?: ~A\ntag: ~A\n" (r? x) (r-def? x) (r-def-lam? x) (block-ref x 0))

)



; types.scm
(module types *

(import scheme)
(import chicken.base)
(import chicken.type)

(import typed-records)

(define-record r
  (id : fixnum)
  (name : string))

(define r-def? r?)
(define r-def-lam? (lambda (a) (r? a)))

)


; results in...
alice@venus:~/code/chicken/record-test % pontiff build --verbose && pontiff run
constructing build order...
building "record-test"...
/usr/bin/env chicken ../src/types.scm -output-file __types.c -specialize -strict-types -local -lfa2 -inline -inline-global -optimize-leaf-routines -emit-import-library types -unit __types -emit-types-file __types.types
/usr/bin/env clang __types.c -o __types.o -c -fno-strict-aliasing -fwrapv -DHAVE_CHICKEN_CONFIG_H -DC_ENABLE_PTABLES -O2 -fomit-frame-pointer -fPIC -DPIC -I/usr/include/chicken

/usr/bin/env chicken ../src/record-test.scm -output-file __record-test.c -specialize -strict-types -local -lfa2 -inline -inline-global -optimize-leaf-routines -uses __types -consult-types-file __types.types
/usr/bin/env clang __record-test.c -o __record-test.o -c -fno-strict-aliasing -fwrapv -DHAVE_CHICKEN_CONFIG_H -DC_ENABLE_PTABLES -O2 -fomit-frame-pointer -fPIC -DPIC -I/usr/include/chicken

/usr/bin/env clang __types.o __record-test.o -o record-test -fuse-ld=lld -L/usr/lib -L/usr/local/lib -Wl,-R/usr/lib -Wl,-R/usr/local/lib -lchicken -lm -ldl
built "record-test"
running "record-test"...
r?: #t
r-def?: #t
r-def-lam?: #f
tag: r

; whereas without -strict-types -specialize...
alice@venus:~/code/chicken/record-test % pontiff build --verbose && pontiff run
constructing build order...
building "record-test"...
/usr/bin/env chicken ../src/types.scm -output-file __types.c -local -lfa2 -inline -inline-global -optimize-leaf-routines -emit-import-library types -unit __types -emit-types-file __types.types
/usr/bin/env clang __types.c -o __types.o -c -fno-strict-aliasing -fwrapv -DHAVE_CHICKEN_CONFIG_H -DC_ENABLE_PTABLES -O2 -fomit-frame-pointer -fPIC -DPIC -I/usr/include/chicken

/usr/bin/env chicken ../src/record-test.scm -output-file __record-test.c -local -lfa2 -inline -inline-global -optimize-leaf-routines -uses __types -consult-types-file __types.types
/usr/bin/env clang __record-test.c -o __record-test.o -c -fno-strict-aliasing -fwrapv -DHAVE_CHICKEN_CONFIG_H -DC_ENABLE_PTABLES -O2 -fomit-frame-pointer -fPIC -DPIC -I/usr/include/chicken

/usr/bin/env clang __types.o __record-test.o -o record-test -fuse-ld=lld -L/usr/lib -L/usr/local/lib -Wl,-R/usr/lib -Wl,-R/usr/local/lib -lchicken -lm -ldl
built "record-test"
running "record-test"...
r?: #t
r-def?: #t
r-def-lam?: #t
tag: types#r

Your annotation:

Enter a new annotation:

Your nick:
The title of your paste:
Your paste (mandatory) :
Type in the text below:
 _   _ _     _ 
| |_| | |__ | |
| __| | '_ \| |
| |_| | | | | |
 \__|_|_| |_|_|
               
Visually impaired? Let me spell it for you (wav file) download WAV