[Chicken-users] Scheme Code beautifier

2010-11-30 Thread Joe Python
Is there a 'Scheme Code beautifier' where I can call within emacs to tidy up
existing code with correct indentations?
___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Re: seg fault

2010-11-30 Thread Felix
From: David Dreisigmeyer dwdreisigme...@gmail.com
Subject: Re: [Chicken-users] Re: seg fault
Date: Mon, 29 Nov 2010 18:44:11 -0500

 It's i386.  This ia a problem with Snow Leopard.  Chicken wouldn't
 compile otherwise, with an error for apply-hack.
 

Ugh. Apple isn't what it used to be anymore... Damn.

Is there a way to detect the correct processor type on this thing?


cheers,
felix

___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Re: seg fault

2010-11-30 Thread David Dreisigmeyer
Thanks Jim. -Dave

On Tue, Nov 30, 2010 at 12:20 AM, Jim Ursetto zbignie...@gmail.com wrote:
 I swear this was documented in the README, but I can't find it now.

 Anyway, instead of changing the Makefile, you just need to pass
 ARCH=x86-64 to the make command, like:

 make PLATFORM=macosx ARCH=x86-64

 Sorry for the inconvenience.
 Jim

 On Mon, Nov 29, 2010 at 17:44, David Dreisigmeyer
 dwdreisigme...@gmail.com wrote:
 It's i386.  This ia a problem with Snow Leopard.  Chicken wouldn't
 compile otherwise, with an error for apply-hack.

 On Mon, Nov 29, 2010 at 4:02 PM, Felix
 fe...@call-with-current-continuation.org wrote:
 From: David Dreisigmeyer dwdreisigme...@gmail.com
 Subject: [Chicken-users] Re: seg fault
 Date: Mon, 29 Nov 2010 13:25:02 -0500

 If I compiled version 4.6.3 everything works fine.  I did have to make
 the following change in Makefile.macosx:

 # platform configuration

 #ARCH ?= $(shell sh $(SRCDIR)/config-arch.sh)
 ARCH = x86-64

 David, what is the output of

  uname -m

 on your machine?


 cheers,
 felix


 ___
 Chicken-users mailing list
 Chicken-users@nongnu.org
 http://lists.nongnu.org/mailman/listinfo/chicken-users



___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Scheme Code beautifier

2010-11-30 Thread matt welland
On xemacs I just do the following:

M-x font-lock-mode  (assuming you don't already have it on)
select the code
ctrl-M \


On Mon, 2010-11-29 at 20:45 -0500, Joe Python wrote:
 Is there a 'Scheme Code beautifier' where I can call within emacs to
 tidy up existing code with correct indentations?
 
 
 ___
 Chicken-users mailing list
 Chicken-users@nongnu.org
 http://lists.nongnu.org/mailman/listinfo/chicken-users



___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Scheme Code beautifier

2010-11-30 Thread Jim Ursetto
Sure Joe, you can use indent-region, which is bound to M-C-\.  It
won't change your linebreaks, but it will reindent your code.

2010/11/29 Joe Python jopyt...@gmail.com:
 Is there a 'Scheme Code beautifier' where I can call within emacs to tidy up
 existing code with correct indentations?

 ___
 Chicken-users mailing list
 Chicken-users@nongnu.org
 http://lists.nongnu.org/mailman/listinfo/chicken-users



___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Scheme Code beautifier

2010-11-30 Thread matt welland
On xemacs I just do the following:

M-x font-lock-mode  (assuming you don't already have it on)
select the code
ctrl-M \


On Mon, 2010-11-29 at 20:45 -0500, Joe Python wrote:
 Is there a 'Scheme Code beautifier' where I can call within emacs to
 tidy up existing code with correct indentations?
 
 
 ___
 Chicken-users mailing list
 Chicken-users@nongnu.org
 http://lists.nongnu.org/mailman/listinfo/chicken-users




___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] c++ example

2010-11-30 Thread Alan Post
On Tue, Nov 30, 2010 at 11:18:49AM -0500, David Dreisigmeyer wrote:
 Hi,
 
 I was hoping to get some help with the c++ hello world example
 below.  I apologize for the question -- I'm currently learning both
 Chicken and C/C++ at the same time.  So far Chicken seems much easier
 than the other Lisps I've tried.  Thanks for the effort and great
 documentation on this implementation -- it's much appreciated.
 
 -Dave
 
 
 If I do the following with C everything works out ok:
 
 *pun.c:
 
 #include stdio.h
 
 void pun(void)
 {
   printf (To C, or not to C: that is the question.\n Or is it?\n);
 }
 
 *pun_module.scm:
 
 (module pun_module (test_pun)
   (import chicken scheme foreign)
 
   (define pun_fun (foreign-lambda void pun))
   
   (define (test_pun)
 (pun_fun)))
   
 *compile:
 
 gcc -c pun.c  csc-4.6.0 -s pun_module.scm pun.o
 
 *at repl:
 
  ,l pun_module.so
  (import pun_module)
  (test_pun)
 
 
 
 
 When I try this:
 
 *pun_cpp.cpp:
 
 #include iostream
 using namespace std;
 
 void pun_cpp (void)
 {
   printf(Hello World!);
   return;
 }
 
 *pun_module.scm:
 
 (module pun_module (test_pun)
   (import chicken scheme foreign)
 
   (define pun_fun (foreign-lambda void pun_cpp))
   
   (define (test_pun)
 (pun_fun)))
   
 *compile:
 
 g++ -c pun_cpp.cpp  csc-4.6.0 -s -c++ pun_module.scm pun_cpp.o
 
 I get the following:
 
 new-host:chicken daviddreisigmeyer$ g++ -c pun_cpp.cpp  csc-4.6.0 -s
 -c++ pun_module.scm pun_cpp.o
 pun_module.cpp: In function ‘long int stub6(long int)’:
 pun_module.cpp:29: error: ‘pun_cpp’ was not declared in this scope
 
 Error: shell command terminated with non-zero exit status 256: g++
 pun_module.cpp -o pun_module.o -c -Wno-write-strings -no-cpp-precomp
 -fno-strict-aliasing -fwrapv -fno-common -DHAVE_CHICKEN_CONFIG_H -m64
 -DC_ENABLE_PTABLES -Os -fomit-frame-pointer -no-cpp-precomp -fPIC
 -DPIC -DC_SHARED
 -I/Users/daviddreisigmeyer/Programming/scheme/chicken-4.6.0//include
 

I'm just guessing here, I don't know that much about FFI in chicken,
but I suspect you need to use:

extern C void pun_cpp (void)

when declaring a routine to be used from a C++ file by Chicken.
Otherwise the linker munges the name to support C++ function
overloading, and Chicken can't find it.

-Alan
-- 
.i ko djuno fi le do sevzi

___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users