A function (that really runs in Gambit):
(define (🍔 🍟) (let ((🎃 <)(🎂 +)(🍣 -)(🍕 1)(🍆 2)) (if (🎃 🍟 🍆) 🍕 (🎂 (🍔 (🍣 🍟 🍆)) (🍔 (🍣 🍟 🍕))))))
Unfortunately, there is not yet a nachos emoji, or we could define fibonachos:
http://www.gocomics.com/foxtrot/2009/02/08/
Brad
Afficher les réponses par date
Really cool!
On Thu, Jan 19, 2017 at 11:25 PM, Bradley Lucier lucier@math.purdue.edu wrote:
A function (that really runs in Gambit):
(define (🍔 🍟) (let ((🎃 <)(🎂 +)(🍣 -)(🍕 1)(🍆 2)) (if (🎃 🍟 🍆) 🍕 (🎂 (🍔 (🍣 🍟 🍆)) (🍔 (🍣 🍟 🍕))))))
Unfortunately, there is not yet a nachos emoji, or we could define fibonachos:
http://www.gocomics.com/foxtrot/2009/02/08/
Brad _______________________________________________ Gambit-list mailing list Gambit-list@iro.umontreal.ca https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
If you try this, make sure you start gsi with the -:t8 flag so that the terminal input/output is UTF-8 encoded. That way you can edit the lines more easily.
Marc
P.S. If Gambit ever adopts a style guide, I think the eggplant should be forbidden in code… ;-)
On Jan 19, 2017, at 6:33 PM, Guillaume Cartier gcartier@jazzscheme.org wrote:
Really cool!
On Thu, Jan 19, 2017 at 11:25 PM, Bradley Lucier lucier@math.purdue.edu wrote: A function (that really runs in Gambit):
(define (🍔 🍟) (let ((🎃 <)(🎂 +)(🍣 -)(🍕 1)(🍆 2)) (if (🎃 🍟 🍆) 🍕 (🎂 (🍔 (🍣 🍟 🍆)) (🍔 (🍣 🍟 🍕))))))
Unfortunately, there is not yet a nachos emoji, or we could define fibonachos:
http://www.gocomics.com/foxtrot/2009/02/08/
Brad _______________________________________________ Gambit-list mailing list Gambit-list@iro.umontreal.ca https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
Gambit-list mailing list Gambit-list@iro.umontreal.ca https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
On Jan 19, 2017, at 7:57 PM, Marc Feeley feeley@iro.umontreal.ca wrote:
If you try this, make sure you start gsi with the -:t8 flag so that the terminal input/output is UTF-8 encoded. That way you can edit the lines more easily.
Really? This seems to work OK (in a Mac OS X Terminal window):
[Media-Mac-mini-3:~] lucier% cat hamburger.scm (define (🍔 x) (if (< x 2) 1 (+ (🍔 (- x 2)) (🍔 (- x 1))))) [Media-Mac-mini-3:~] lucier% emacs hamburger.scm [Media-Mac-mini-3:~] lucier% gsi Gambit v4.8.6
(load "hamburger")
"/Users/lucier/hamburger.scm"
(🍔 6)
13
(🍔 7)
21
(🍔 8)
34
Yes it “works”… but for the wrong reasons… try
(pp 🍔)
and you will see your code has no burger in it. That’s because when you entered a burger at the terminal Gambit saw that as a 4 character symbol, i.e. |\360\237\215\224| . To get a real burger (single Unicode character), you need the -:t8 .
Marc
On Jan 19, 2017, at 8:02 PM, Bradley Lucier lucier@math.purdue.edu wrote:
On Jan 19, 2017, at 7:57 PM, Marc Feeley feeley@iro.umontreal.ca wrote:
If you try this, make sure you start gsi with the -:t8 flag so that the terminal input/output is UTF-8 encoded. That way you can edit the lines more easily.
Really? This seems to work OK (in a Mac OS X Terminal window):
[Media-Mac-mini-3:~] lucier% cat hamburger.scm (define (🍔 x) (if (< x 2) 1 (+ (🍔 (- x 2)) (🍔 (- x 1))))) [Media-Mac-mini-3:~] lucier% emacs hamburger.scm [Media-Mac-mini-3:~] lucier% gsi Gambit v4.8.6
(load "hamburger")
"/Users/lucier/hamburger.scm"
(🍔 6)
13
(🍔 7)
21
(🍔 8)
34
cool :)
On Thu, Jan 19, 2017 at 5:08 PM, Marc Feeley feeley@iro.umontreal.ca wrote:
Yes it “works”… but for the wrong reasons… try
(pp 🍔)
and you will see your code has no burger in it. That’s because when you entered a burger at the terminal Gambit saw that as a 4 character symbol, i.e. |\360\237\215\224| . To get a real burger (single Unicode character), you need the -:t8 .
Marc
On Jan 19, 2017, at 8:02 PM, Bradley Lucier lucier@math.purdue.edu
wrote:
On Jan 19, 2017, at 7:57 PM, Marc Feeley feeley@iro.umontreal.ca
wrote:
If you try this, make sure you start gsi with the -:t8 flag so that the
terminal input/output is UTF-8 encoded. That way you can edit the lines more easily.
Really? This seems to work OK (in a Mac OS X Terminal window):
[Media-Mac-mini-3:~] lucier% cat hamburger.scm (define (🍔 x) (if (< x 2) 1 (+ (🍔 (- x 2)) (🍔 (- x 1))))) [Media-Mac-mini-3:~] lucier% emacs hamburger.scm [Media-Mac-mini-3:~] lucier% gsi Gambit v4.8.6
(load "hamburger")
"/Users/lucier/hamburger.scm"
(🍔 6)
13
(🍔 7)
21
(🍔 8)
34
Gambit-list mailing list Gambit-list@iro.umontreal.ca https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
On Jan 19, 2017, at 8:08 PM, Marc Feeley feeley@iro.umontreal.ca wrote:
Yes it “works”… but for the wrong reasons… try
(pp 🍔)
and you will see your code has no burger in it. That’s because when you entered a burger at the terminal Gambit saw that as a 4 character symbol, i.e. |\360\237\215\224| . To get a real burger (single Unicode character), you need the -:t8 .
There doesn’t seem to be any documentation for the “load” procedure in the gambit documentation (hard to believe, I know, but I sure as hell couldn’t find any).
Brad
Many of the Scheme standard procedures aren’t documented. By the way, for load to use UTF-8 encoding for the files it loads, you need to add -:f8 option to gsi.
Marc
On Jan 19, 2017, at 8:50 PM, Bradley Lucier lucier@math.purdue.edu wrote:
On Jan 19, 2017, at 8:08 PM, Marc Feeley feeley@iro.umontreal.ca wrote:
Yes it “works”… but for the wrong reasons… try
(pp 🍔)
and you will see your code has no burger in it. That’s because when you entered a burger at the terminal Gambit saw that as a 4 character symbol, i.e. |\360\237\215\224| . To get a real burger (single Unicode character), you need the -:t8 .
There doesn’t seem to be any documentation for the “load” procedure in the gambit documentation (hard to believe, I know, but I sure as hell couldn’t find any).
Brad
On Jan 19, 2017, at 9:11 PM, Marc Feeley feeley@iro.umontreal.ca wrote:
Many of the Scheme standard procedures aren’t documented.
I would hardly call Gambit’s “load” procedure “standard”.
By the way, for load to use UTF-8 encoding for the files it loads, you need to add -:f8 option to gsi.
You read my mind. So you need
gsi -:t8,f8
Or, I suppose you could use
[Media-Mac-mini-3:~] lucier% gsi -:t8 Gambit v4.8.6
(load (list path: "hamburger.scm" char-encoding: 'UTF-8))
"/Users/lucier/hamburger.scm"
🍔
#<procedure #2 🍔>
(pp 🍔 )
(lambda (x) (if (< x 2) 1 (+ (🍔 (- x 2)) (🍔 (- x 1)))))
which also seems to work.
So maybe the documentation could just say that the form of load is
(load path-or-settings)
Brad