Re: [Chicken-users] Generic RDBMS Interface [Was: Re: Creating Windows GUI App]

2011-04-02 Thread Thomas Chust
2011/4/2 Matt Welland estifo...@gmail.com:
 - Original message -
 2011/4/1 Jim Ursetto zbignie...@gmail.com:
 [...]
 Just use an alist.
 [...]

 Maybe less practical to enter on command lines, but probably more
 schemish, yes :-)

 How about a convinence function to convert the URI to an alist for those who
 prefer and for command line ease?
 [...]

This is Scheme, procedures don't have to have static type signature. I
may just allow all of the following three styles at the same time:

  (import (prefix dbi dbi:) uri-generic)

  (dbi:connect '(postgresql [host . example.com] [database . blubb]
[tty . log]))
  ;; OR
  (dbi:connect postgresql://example.com/blubb?tty=log)
  ;; OR
  (dbi:connect (uri-reference postgresql://example.com/blubb?tty=log))

Ciao,
Thomas


-- 
When C++ is your hammer, every problem looks like your thumb.

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


[Chicken-users] Using csi within Vim to evaluate visually selected text

2011-04-02 Thread John Magolske
Hi all,

Recently I've become interested in learning and using scheme. Liking
a lot of what I've seen of Chicken Scheme, I've settled on using this
implementation while working my way through SICP.

I use Vim and wanted to be able to visually select snippets of code
within a text file, run them through csi, then view the output in
Vim's command line area with the option of pasting that output into
the buffer below the selected text. Here's what I came up with...
In my vimrc there is:

  vmap silent leaderc :w! /tmp/scheme-snippetcr}:!csi-vim-cmdcr:
  command I r !csi-vim-cmd

Where csi-vim-cmd is a shell script like:

  #!/bin/sh
  csi -q  /tmp/scheme-snippet | \
  sed -e s/^\#\;.*$// -e s/\#\;[0-9]*\// -e s/^---\.*$// -e /^$/d

It seems similar functionality must've already been implemented
somewhere, but searching about I didn't find anything. I know there
are various Vim scripts out there [1], but I just wanted something
simple so I could evaluate exercises as I typed up my notes. Being new
to scheme, it wouldn't surprise me if there are things that could be
fixed/improved. Any comments or suggestions are much appreciated.

BTW, if anyone's in the San Francisco Bay area  interested, we've
started a scheme meetup [2] on Sundays at the Noisebridge hackerspace.

[1] http://www.vim.org/scripts/script.php?script_id=2531
http://www.vim.org/scripts/script.php?script_id=1079
http://vim.sourceforge.net/scripts/script.php?script_id=221
http://vim.sourceforge.net/scripts/script.php?script_id=2219

[2] https://www.noisebridge.net/wiki/Schemers

https://www.noisebridge.net/pipermail/noisebridge-discuss/2011-April/022411.html

Cheers!

John

-- 
John Magolske
http://B79.net/contact

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


Re: [Chicken-users] Using csi within Vim to evaluate visually selected text

2011-04-02 Thread Evan Hanson
In case you haven't seen it already, there's a page on using Chicken with Vim
on the wiki: http://wiki.call-cc.org/vim?action=show. It has some similar
functionality there but I'm sure your contribution would be welcome there as
well.

Evan

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