Re: [Chicken-users] 4.8.0.5 syntax weirdness
On Mon, Mar 10, 2014 at 11:22:53PM -0500, Jim Ursetto wrote: This is the fix: commit f8230a466ce3a86f360178f115fb62ee124448b9 Author: Peter Bex peter@xs4all.nl Date: Sun Jun 30 18:50:09 2013 +0200 Fix meta-evaluation to actually take place in the meta environment and add tests Signed-off-by: Christian Kellermann ck...@pestilenz.org It seems pretty simple and applies cleanly to stability and tests out ok. Do you think I should apply it? Thanks for checking that, Jim! Considering we have a few other post-4.8.0.5 patches, it might be worth tagging a 4.8.0.6 release. That will be quicker than waiting for the two remaining patches, starting the release cycle with release candidates, having periods of testing etc. Cheers, Peter -- http://www.more-magic.net ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
[Chicken-users] [TFP2014] Final Call For Papers
- F I N A L C A L L F O R P A P E R S - TFP 2014 === 15th Symposium on Trends in Functional Programming May 26-28, 2014 Utrecht University Soesterberg, The Netherlands http://www.cs.uu.nl/wiki/TFP2014/WebHome *** Submission for TFP 2014 is now open: please direct your browser to *** http://www.cs.uu.nl/wiki/TFP2014/PaperSubmission The symposium on Trends in Functional Programming (TFP) is an international forum for researchers with interests in all aspects of functional programming, taking a broad view of current and future trends in the area. It aspires to be a lively environment for presenting the latest research results, and other contributions (see below), described in draft papers submitted prior to the symposium. A formal post-symposium refereeing process then selects a subset of the articles presented at the symposium and submitted for formal publication. Selected revised papers will be published as a Springer Lecture Notes in Computer Science (LNCS) volume. TFP 2014 will be the main event of a pair of functional programming events. The other is the International Workshop on Trends in Functional Programming in Education (TFPIE). TFPIE will take place on May 25th. Its website is located at http://www.cs.uwyo.edu/~jlc/tfpie14/ The TFP symposium is the heir of the successful series of Scottish Functional Programming Workshops. Previous TFP symposia were held in Edinburgh (Scotland) in 2003, in Munich (Germany) in 2004, in Tallinn (Estonia) in 2005, in Nottingham (UK) in 2006, in New York (USA) in 2007, in Nijmegen (The Netherlands) in 2008, in Komarno (Slovakia) in 2009, in Oklahoma (USA) in 2010, in Madrid (Spain) in 2011, St. Andrews (UK) in 2012 and Provo (Utah, USA) in 2013. For further general information about TFP please see the TFP homepage. INVITED SPEAKERS TFP is pleased to announce talks by the following two invited speakers: John Hughes of Chalmers, Goteborg, Sweden, is well-known as author of Why Functional Programming Matters, and as one of the designers of QuickCheck (together with Koen Claessen); the paper on QuickCheck won the ICFP Most Influential Paper Award in 2010. Currently he divides his time between his professorship and Quviq, a company that performs property-based testing of software with a tool implemented in Erlang. Dr. Geoffrey Mainland received his PhD from Harvard University where he was advised by Greg Morrisett and Matt Welsh. After a two year postdoc with the Programming Principles and Tools group at Microsoft Research Cambridge, he is now an assistant professor at Drexel University. His research focuses on high-level programming language and runtime support for non-general purpose computation. SCOPE The symposium recognizes that new trends may arise through various routes. As part of the Symposium's focus on trends we therefore identify the following five article categories. High-quality articles are solicited in any of these categories: Research Articles: leading-edge, previously unpublished research work Position Articles: on what new trends should or should not be Project Articles: descriptions of recently started new projects Evaluation Articles: what lessons can be drawn from a finished project Overview Articles: summarizing work with respect to a trendy subject Articles must be original and not submitted for simultaneous publication to any other forum. They may consider any aspect of functional programming: theoretical, implementation-oriented, or more experience-oriented. Applications of functional programming techniques to other languages are also within the scope of the symposium. Topics suitable for the symposium include: Functional programming and multicore/manycore computing Functional programming in the cloud High performance functional computing Extra-functional (behavioural) properties of functional programs Dependently typed functional programming Validation and verification of functional programs Using functional techniques to reason about imperative/object-oriented programs Debugging for functional languages Functional programming in different application areas: security, mobility, telecommunications applications, embedded systems, global computing, grids, etc. Interoperability with imperative programming languages Novel memory management techniques Program analysis and transformation techniques Empirical performance studies Abstract/virtual machines and compilers for functional languages (Embedded) domain specific languages New implementation strategies Any new emerging trend in the functional programming area If you are in doubt on whether your article is within the scope of TFP, please contact the TFP 2014 program chair, Jurriaan Hage at
Re: [Chicken-users] Review my Caesar Cipher?
With the last suggestion from Alex, and a tip to use cond-expand from Kon, I have settled on the following: - ; ; Works with Chicken Scheme and Gauche. ; (cond-expand (chicken (use srfi-13)) (gauche (use srfi-13))) (define msg The quick brown fox jumps over the lazy dog.) (define key 13) (define (caesar char) (define A (char-integer #\A)) (define Z (char-integer #\Z)) (define a (char-integer #\a)) (define z (char-integer #\z)) (define c (char-integer char)) (integer-char (cond ((= A c Z) (+ A (modulo (+ key (- c A)) 26))) ((= a c z) (+ a (modulo (+ key (- c a)) 26))) (else c ; Return other characters verbatim. (print (string-map caesar msg)) - I tried to include more Schemes, but Chibi doesn't seem to have SRFI-13, Racket doesn't support SRFI-0 (cond-expand), and Stklos is case-insensitive. There are other schemes that support both SRFI-0 and 13, but AFAICT they are not active. Even Stklos seems to have gone into a slumber 2.5 years ago. I have updated the Rosetta Code page. Since this code includes a lot of advice from experienced Schemers, I have removed the novice note. http://rosettacode.org/wiki/Caesar_cipher#Scheme Cheers, Daniel. On 11 March 2014 02:09, Alex Shinn alexsh...@gmail.com wrote: (integer-char (cond ((= A c Z) (+ A (modulo (+ key (- c A)) 26))) ((= a c z) (+ a (modulo (+ key (- c A)) 26))) (else c))) -- When an engineer says that something can't be done, it's a code phrase that means it's not fun to do. ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Review my Caesar Cipher?
On Tue, Mar 11, 2014 at 7:15 PM, Daniel Carrera dcarr...@gmail.com wrote: With the last suggestion from Alex, and a tip to use cond-expand from Kon, I have settled on the following: - ; ; Works with Chicken Scheme and Gauche. ; (cond-expand (chicken (use srfi-13)) (gauche (use srfi-13))) (define msg The quick brown fox jumps over the lazy dog.) (define key 13) (define (caesar char) (define A (char-integer #\A)) (define Z (char-integer #\Z)) (define a (char-integer #\a)) (define z (char-integer #\z)) (define c (char-integer char)) (integer-char (cond ((= A c Z) (+ A (modulo (+ key (- c A)) 26))) ((= a c z) (+ a (modulo (+ key (- c a)) 26))) (else c ; Return other characters verbatim. (print (string-map caesar msg)) - I tried to include more Schemes, but Chibi doesn't seem to have SRFI-13 Chibi has string-map in (chibi string). But actually, if you're aiming for R7RS support then string-map is in (scheme base). Just replace the cond-expand with: (import (scheme base)) -- Alex ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Review my Caesar Cipher?
On 11 March 2014 12:41, Alex Shinn alexsh...@gmail.com wrote: Chibi has string-map in (chibi string). But actually, if you're aiming for R7RS support then string-map is in (scheme base). Just replace the cond-expand with: (import (scheme base)) Hmm... sadly, (import (scheme base)) fails with Chicken and Gauche. I am also having a hard time figuring out how to print with Chibi. I tried the manual, and I tried (print), (printf) and (display). Cheers, Daniel. -- When an engineer says that something can't be done, it's a code phrase that means it's not fun to do. ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
[Chicken-users] Problem with (fold)
Hello, I'm having a problem with (fold): (use srfi-1) ; List library. (fold (lambda (a b) (+ (* a 10) b)) 0 '(1 2 3)) I was expecting this to return 123, but it returns 60. I'm confused. In my mind, at each step I shift the current value to the left (i.e. multiply by 10) and add the new digit. So the steps should be: 1 , 2 -- 10 + 1 = 12 12 , 3 -- 120 + 3 = 123 What am I missing? Cheers, Daniel. -- When an engineer says that something can't be done, it's a code phrase that means it's not fun to do. ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Problem with (fold)
I think I've answered my own question: I have to switch the a and the b. I guess I was confused as to how parameters are sent into the lambda. Cheers, Daniel. On 11 March 2014 15:30, Daniel Carrera dcarr...@gmail.com wrote: Hello, I'm having a problem with (fold): (use srfi-1) ; List library. (fold (lambda (a b) (+ (* a 10) b)) 0 '(1 2 3)) I was expecting this to return 123, but it returns 60. I'm confused. In my mind, at each step I shift the current value to the left (i.e. multiply by 10) and add the new digit. So the steps should be: 1 , 2 -- 10 + 1 = 12 12 , 3 -- 120 + 3 = 123 What am I missing? Cheers, Daniel. -- When an engineer says that something can't be done, it's a code phrase that means it's not fun to do. -- When an engineer says that something can't be done, it's a code phrase that means it's not fun to do. ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Problem with (fold)
On Tue, Mar 11, 2014 at 03:30:56PM +0100, Daniel Carrera wrote: Hello, I'm having a problem with (fold): (use srfi-1) ; List library. (fold (lambda (a b) (+ (* a 10) b)) 0 '(1 2 3)) I was expecting this to return 123, but it returns 60. I'm confused. In my mind, at each step I shift the current value to the left (i.e. multiply by 10) and add the new digit. So the steps should be: 1 , 2 -- 10 + 1 = 12 12 , 3 -- 120 + 3 = 123 What am I missing? You need to multiply the memo by 10, not the item: #;1 (use srfi-1) #;2 (fold (lambda (a b) (print `(+ (* ,a 10) ,b)) (+ (* a 10) b)) 0 '(1 2 3)) (+ (* 1 10) 0) (+ (* 2 10) 10) (+ (* 3 10) 30) 60 #;3 (fold (lambda (a b) (+ (* b 10) a)) 0 '(1 2 3)) 123 To avoid such mistakes, it's helpful to use mnemonic names: (fold (lambda (item result) (+ (* result 10) item)) 0 '(1 2 3)) Cheers, Peter -- http://www.more-magic.net ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Problem with (fold)
On 11 March 2014 15:41, Peter Bex peter@xs4all.nl wrote: To avoid such mistakes, it's helpful to use mnemonic names: (fold (lambda (item result) (+ (* result 10) item)) 0 '(1 2 3)) Thanks. I was mentally reading from left to right, so I ended up assuming that it was (result item). Cheers, Daniel. -- When an engineer says that something can't be done, it's a code phrase that means it's not fun to do. ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Review my Caesar Cipher?
(Sorry for off-topic of ML) From: Daniel Carrera dcarr...@gmail.com Subject: Re: [Chicken-users] Review my Caesar Cipher? Date: Tue, 11 Mar 2014 13:20:15 +0100 Hmm... sadly, (import (scheme base)) fails with Chicken and Gauche. Development head of Gauche already supports r7rs, FYI. --shiro ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Problem with (fold)
On Tue, Mar 11, 2014 at 03:47:53PM +0100, Daniel Carrera wrote: On 11 March 2014 15:41, Peter Bex peter@xs4all.nl wrote: To avoid such mistakes, it's helpful to use mnemonic names: (fold (lambda (item result) (+ (* result 10) item)) 0 '(1 2 3)) Thanks. I was mentally reading from left to right, so I ended up assuming that it was (result item). That would make more sense, I guess, and is the ordering used by other functional languages. There's a built-in version of fold which obeys this ordering, called foldl: http://api.call-cc.org/doc/library/foldl I think SRFI-1's FOLD uses the oher way around is because of the notion that the procedure argument is called a CONStructor, and cons accepts the item first and the list on which to cons second, making reverse trivial to implement like this: (fold cons '() '(1 2 3 4)) = (4 3 2 1) I find it's easy enough to remember if you keep this in mind. Cheers, Peter -- http://www.more-magic.net ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Review my Caesar Cipher?
Shiro Kawai scripsit: Development head of Gauche already supports r7rs, FYI. Excellent news! -- John Cowan co...@ccil.orghttp://ccil.org/~cowan No man is an island, entire of itself; every man is a piece of the continent, a part of the main. If a clod be washed away by the sea, Europe is the less, as well as if a promontory were, as well as if a manor of thy friends or of thine own were: any man's death diminishes me, because I am involved in mankind, and therefore never send to know for whom the bell tolls; it tolls for thee. --John Donne ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] 4.8.0.5 syntax weirdness
Ok. May not be able to make a full release for a few days but will push out the change Wednesday, at least. On Mar 11, 2014, at 2:31, Peter Bex peter@xs4all.nl wrote: On Mon, Mar 10, 2014 at 11:22:53PM -0500, Jim Ursetto wrote: This is the fix: commit f8230a466ce3a86f360178f115fb62ee124448b9 Author: Peter Bex peter@xs4all.nl Date: Sun Jun 30 18:50:09 2013 +0200 Fix meta-evaluation to actually take place in the meta environment and add tests Signed-off-by: Christian Kellermann ck...@pestilenz.org It seems pretty simple and applies cleanly to stability and tests out ok. Do you think I should apply it? Thanks for checking that, Jim! Considering we have a few other post-4.8.0.5 patches, it might be worth tagging a 4.8.0.6 release. That will be quicker than waiting for the two remaining patches, starting the release cycle with release candidates, having periods of testing etc. Cheers, Peter -- http://www.more-magic.net ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users