Re: [Chicken-users] Chicken For Ruby Programmers
this is a good outline. hopefully i'll have some time tomorrow to start writing a few sections and we'll see how it goes. On Feb 19, 2008, at 11:06 PM, Mark Fredrickson wrote: Hi Raymond, I've added my 1st draft presentation outline: https://galinha.ucpel.tche.br/cgi-bin/svnwiki/default/chicken-for-ruby-programmers This is just my rambling thoughts on what my Ruby group might be interested in. On Feb 19, 2008, at 9:37 PM, raymond medeiros wrote: I actually have a profile page. Well specific correlations between languages would be good, I think for this document it would be best to show how things like map work in ruby and in scheme. Agreed. I think showing how Ruby knowledge is immediately applicable in Scheme is a good tack to take. For example, Hash.new is like (make-hash-table). There are a few articles out there under various names you might want to read up on. Search for "functional programming in ruby" and also "ruby lisp". I was thinking something along those lines, because we can relate those paradigms in both languages. Also what i'd like to see is emphasis on meta-programming in Ruby vs meta-programming in lisp. That's just off the top of my head. While I don't disagree that showing off metaprogramming would be useful, I think I may focus on more "immediate" task needs: shell scripting, regexes, various object systems, eggs vs. gems. I think this balance of quick-start, immediate needs with a higher level idiom and meta-programming comparison would make a very strong introduction. Divide and conquer! something else to consider, would it be prudent to create an introductory tutorial on spiffy/web-unity/mettle and show how one might pursue web development for people who currently use a framework like RoR? Certainly. It's not my area of expertise, but perhaps we can draft some more individuals. I think such a tutorial could have more value if it also addressed other web frameworks such as Struts or CakePHP. Cheers, -M ___ 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] Chicken For Ruby Programmers
Hi Raymond, I've added my 1st draft presentation outline: https://galinha.ucpel.tche.br/cgi-bin/svnwiki/default/chicken-for-ruby-programmers This is just my rambling thoughts on what my Ruby group might be interested in. On Feb 19, 2008, at 9:37 PM, raymond medeiros wrote: I actually have a profile page. Well specific correlations between languages would be good, I think for this document it would be best to show how things like map work in ruby and in scheme. Agreed. I think showing how Ruby knowledge is immediately applicable in Scheme is a good tack to take. For example, Hash.new is like (make- hash-table). There are a few articles out there under various names you might want to read up on. Search for "functional programming in ruby" and also "ruby lisp". I was thinking something along those lines, because we can relate those paradigms in both languages. Also what i'd like to see is emphasis on meta-programming in Ruby vs meta-programming in lisp. That's just off the top of my head. While I don't disagree that showing off metaprogramming would be useful, I think I may focus on more "immediate" task needs: shell scripting, regexes, various object systems, eggs vs. gems. I think this balance of quick-start, immediate needs with a higher level idiom and meta-programming comparison would make a very strong introduction. Divide and conquer! something else to consider, would it be prudent to create an introductory tutorial on spiffy/web-unity/mettle and show how one might pursue web development for people who currently use a framework like RoR? Certainly. It's not my area of expertise, but perhaps we can draft some more individuals. I think such a tutorial could have more value if it also addressed other web frameworks such as Struts or CakePHP. Cheers, -M ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Chicken For Ruby Programmers
something else to consider, would it be prudent to create an introductory tutorial on spiffy/web-unity/mettle and show how one might pursue web development for people who currently use a framework like RoR? On Feb 19, 2008, at 10:14 PM, Mark Fredrickson wrote: Hi Raymond, On Feb 19, 2008, at 7:16 PM, Raymond Medeiros wrote: Hi, myself and my friend Liam Irish were considering working on this portion of the hack-a-thon. So I'm throwing it out there, I noticed that Mark Fredrickson is already on the list for Ruby. Great! I know Peter Bex also expressed a willigness to help. The more help the better. I have absolutely no intention of monopolizing this work! I would encourage you to add your name(s) to the list. Also, Mario is encouraging people to add profile pages, and this might be a good time to do both. We both have extensive "real world" experience with Ruby as a language, might not be so strong on the scheme side, but could possibly lend a hand in fleshing this out. Cool. I have less Ruby experience, but I agreed to give a presentation on Scheme to my local Ruby user's group. I would greatly value your experience. BTW, I love the "Chicken for X Programmers" I think that this is precisely the kind of thing Chicken needs to gain more exposure. I welcome any comments suggestions on this. Neither a comment nor suggestion, but a question: As a Ruby programmer, what would you like to see in an introductory document? I was brainstorming ideas tonight, and I find it hard to decide whether to focus on very specific topics (e.g. "Instead of a Hash class, you can use (make-hash-table)") vs. higher level concepts (e.g. "Blocks are like anonymous functions."). I suspect these intro docs will be a combo of the two. Cheers, -Mark ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Chicken For Ruby Programmers
http://www.randomhacks.net/articles/2005/12/03/why-ruby-is-an-acceptable-lisp http://tech.rufy.com/2006/11/functional-programming-in-ruby.html were the articles i was thinking about in particular, might make for a good starting place for ideas on how to organize the wiki entry. we should probably start with an outline, what i don't want is a table of "this in ruby vs this in lisp", I'd rather see idiom comparison. On Feb 19, 2008, at 10:14 PM, Mark Fredrickson wrote: Hi Raymond, On Feb 19, 2008, at 7:16 PM, Raymond Medeiros wrote: Hi, myself and my friend Liam Irish were considering working on this portion of the hack-a-thon. So I'm throwing it out there, I noticed that Mark Fredrickson is already on the list for Ruby. Great! I know Peter Bex also expressed a willigness to help. The more help the better. I have absolutely no intention of monopolizing this work! I would encourage you to add your name(s) to the list. Also, Mario is encouraging people to add profile pages, and this might be a good time to do both. We both have extensive "real world" experience with Ruby as a language, might not be so strong on the scheme side, but could possibly lend a hand in fleshing this out. Cool. I have less Ruby experience, but I agreed to give a presentation on Scheme to my local Ruby user's group. I would greatly value your experience. BTW, I love the "Chicken for X Programmers" I think that this is precisely the kind of thing Chicken needs to gain more exposure. I welcome any comments suggestions on this. Neither a comment nor suggestion, but a question: As a Ruby programmer, what would you like to see in an introductory document? I was brainstorming ideas tonight, and I find it hard to decide whether to focus on very specific topics (e.g. "Instead of a Hash class, you can use (make-hash-table)") vs. higher level concepts (e.g. "Blocks are like anonymous functions."). I suspect these intro docs will be a combo of the two. Cheers, -Mark ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Chicken For Ruby Programmers
I actually have a profile page. Well specific correlations between languages would be good, I think for this document it would be best to show how things like map work in ruby and in scheme. There are a few articles out there under various names you might want to read up on. Search for "functional programming in ruby" and also "ruby lisp". I was thinking something along those lines, because we can relate those paradigms in both languages. Also what i'd like to see is emphasis on meta-programming in Ruby vs meta-programming in lisp. That's just off the top of my head. On Feb 19, 2008, at 10:14 PM, Mark Fredrickson wrote: Hi Raymond, On Feb 19, 2008, at 7:16 PM, Raymond Medeiros wrote: Hi, myself and my friend Liam Irish were considering working on this portion of the hack-a-thon. So I'm throwing it out there, I noticed that Mark Fredrickson is already on the list for Ruby. Great! I know Peter Bex also expressed a willigness to help. The more help the better. I have absolutely no intention of monopolizing this work! I would encourage you to add your name(s) to the list. Also, Mario is encouraging people to add profile pages, and this might be a good time to do both. We both have extensive "real world" experience with Ruby as a language, might not be so strong on the scheme side, but could possibly lend a hand in fleshing this out. Cool. I have less Ruby experience, but I agreed to give a presentation on Scheme to my local Ruby user's group. I would greatly value your experience. BTW, I love the "Chicken for X Programmers" I think that this is precisely the kind of thing Chicken needs to gain more exposure. I welcome any comments suggestions on this. Neither a comment nor suggestion, but a question: As a Ruby programmer, what would you like to see in an introductory document? I was brainstorming ideas tonight, and I find it hard to decide whether to focus on very specific topics (e.g. "Instead of a Hash class, you can use (make-hash-table)") vs. higher level concepts (e.g. "Blocks are like anonymous functions."). I suspect these intro docs will be a combo of the two. Cheers, -Mark ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Chicken For Ruby Programmers
Hi Raymond, On Feb 19, 2008, at 7:16 PM, Raymond Medeiros wrote: Hi, myself and my friend Liam Irish were considering working on this portion of the hack-a-thon. So I'm throwing it out there, I noticed that Mark Fredrickson is already on the list for Ruby. Great! I know Peter Bex also expressed a willigness to help. The more help the better. I have absolutely no intention of monopolizing this work! I would encourage you to add your name(s) to the list. Also, Mario is encouraging people to add profile pages, and this might be a good time to do both. We both have extensive "real world" experience with Ruby as a language, might not be so strong on the scheme side, but could possibly lend a hand in fleshing this out. Cool. I have less Ruby experience, but I agreed to give a presentation on Scheme to my local Ruby user's group. I would greatly value your experience. BTW, I love the "Chicken for X Programmers" I think that this is precisely the kind of thing Chicken needs to gain more exposure. I welcome any comments suggestions on this. Neither a comment nor suggestion, but a question: As a Ruby programmer, what would you like to see in an introductory document? I was brainstorming ideas tonight, and I find it hard to decide whether to focus on very specific topics (e.g. "Instead of a Hash class, you can use (make-hash-table)") vs. higher level concepts (e.g. "Blocks are like anonymous functions."). I suspect these intro docs will be a combo of the two. Cheers, -Mark ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
[Chicken-users] Chicken For Ruby Programmers
Hi, myself and my friend Liam Irish were considering working on this portion of the hack-a-thon. So I'm throwing it out there, I noticed that Mark Fredrickson is already on the list for Ruby. We both have extensive "real world" experience with Ruby as a language, might not be so strong on the scheme side, but could possibly lend a hand in fleshing this out. BTW, I love the "Chicken for X Programmers" I think that this is precisely the kind of thing Chicken needs to gain more exposure. I welcome any comments suggestions on this. ./rm ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] aliases in the wiki
Alejandro Forero Cuervo wrote: What do you propose we do if we have a function with the same name as an egg? Perhaps it wasn't clear from my message, but I was proposing the “egg-” prefix only in those cases where there is a clash. Yes, I misread that part. I guess renaming the egg page as egg-* is the most sensible thing to do, so that the overloaded name can point to a disambiguation page. Tobia ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] aliases in the wiki
> >For the egg pages we would simply prefix them (so format-modular > >would become egg-format-modular) > > This I'm not so sure about, because sometimes you remember the name of > a procedure but not its egg, and because usually eggs become part of > the domain-specific language you assemble to solve your problem, after > which you don't care much anymore which egg the procedures came from. What do you propose we do if we have a function with the same name as an egg? Perhaps it wasn't clear from my message, but I was proposing the “egg-” prefix only in those cases where there is a clash. Alejo. http://azul.freaks-unidos.net/ ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Topics and a main index (was: egg documentation)
Graham Fawcett wrote: it could be handled in a cascading fashion. A tag on the egg would suffice, but a tag on the procedure could enhance or override it. My thoughts precisely. Perhaps, but it would make a nice hackathon job: if the mechanism is there, someone could zip through an egg's doc and tag a few dozen specialized procedures. I'm sure I would do it, if nothing else to find obscure procedures easily again, using the topic indices. I agree that in general an egg-level tag is enough; but there are lots of corner cases. Procedure level tags should be optional, but could be useful. Useful especially for tagging the builtin units and other "grab bags" of miscellaneous procedures. Tobia ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] passing variable number of floats to C
On Feb 19, 2008, at 11:32 AM, Heinrich Taube wrote: thanks, i see now. since its a list it would be nice from the users perspective to be able to pass immediate ints in addition to floats without having to cons the floats on the scheme side. so on the c side ill have to make sure that the car is either an int or a float before i access it -- ive been poking around in the doc but dont see any obvious predicates to do this. The "C Interface" section (http://galinha.ucpel.tche.br/C% 20interface) is incomplete. This should be a To Do item. For now look in the source @ "chicken.h". can you please point me in the right direction? thanks for your help! for ( ; C_SCHEME_END_OF_LIST != lyst; lyst = C_u_i_cdr( lyst )) { if ( IS_INT(C_u_i_car(lyst)) ) sum += (double)C_u_i_car(lyst) ; else if ( IS_FLOAT(C_u_i_car(lyst)) sum += C_u_i_car(lyst) ; } /* C_truep used here since the predicate macros - F_foop - have Chicken Scheme boolean results, not C. */ double sum = 0.0; for ( ; C_SCHEME_END_OF_LIST != lyst; lyst = C_u_i_cdr( lyst )) { C_word word = C_u_i_car( lyst ); if (C_truep( C_flonump( word ) )) { sum += C_flonum_magnitude( word ); } else if (C_truep( C_fixnump( word ) )) { sum += (double) C_unfix( word ); } } If we were only interested in integers then "C_num_to_int" could be used. But this works: #> static double double_sum( C_word lyst ) { double sum = 0.0; for ( ; C_SCHEME_END_OF_LIST != lyst; lyst = C_u_i_cdr( lyst )) { sum += C_flonum_magnitude( C_u_i_car( lyst ) ); } return sum; } <# Best Wishes, Kon ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] passing variable number of floats to C
thanks, i see now. since its a list it would be nice from the users perspective to be able to pass immediate ints in addition to floats without having to cons the floats on the scheme side. so on the c side ill have to make sure that the car is either an int or a float before i access it -- ive been poking around in the doc but dont see any obvious predicates to do this. can you please point me in the right direction? thanks for your help! for ( ; C_SCHEME_END_OF_LIST != lyst; lyst = C_u_i_cdr( lyst )) { if ( IS_INT(C_u_i_car(lyst)) ) sum += (double)C_u_i_car(lyst) ; else if ( IS_FLOAT(C_u_i_car(lyst)) sum += C_u_i_car(lyst) ; } But this works: #> static double double_sum( C_word lyst ) { double sum = 0.0; for ( ; C_SCHEME_END_OF_LIST != lyst; lyst = C_u_i_cdr( lyst )) { sum += C_flonum_magnitude( C_u_i_car( lyst ) ); } return sum; } <# ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Topics and a main index (was: egg documentation)
On Feb 19, 2008 2:10 PM, Jim Ursetto <[EMAIL PROTECTED]> wrote: > Your topic idea is interesting. My opinion, for what it's worth, is that it > imposes too much on the user when required for every definition. Instead, if > any topic indexing is to be done in the future, I think the topics could be > drawn from the egg tags themselves. Well, it could be handled in a cascading fashion. A tag on the egg would suffice, but a tag on the procedure could enhance or override it. Take an egg like miscmacros, which itself is hard to classify, but whose procedures could be tagged with 'list-manipulation', 'conditionals', etc. > I think using the egg tags (categories) would be sufficient for any future > index. Any more granular and there is a high barrier to entry. Users would > avoid changing entries for fear of putting something in the wrong category; > old hands would get fatigued at choosing topics for every definition. Perhaps, but it would make a nice hackathon job: if the mechanism is there, someone could zip through an egg's doc and tag a few dozen specialized procedures. I agree that in general an egg-level tag is enough; but there are lots of corner cases. Procedure level tags should be optional, but could be useful. Graham ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Topics and a main index (was: egg documentation)
Your topic idea is interesting. My opinion, for what it's worth, is that it imposes too much on the user when required for every definition. Instead, if any topic indexing is to be done in the future, I think the topics could be drawn from the egg tags themselves. For example, it's a safe bet that nearly all procedures in the "dyn-vector" egg have to do with "vector", everything in the objc egg has to do with "macosx", "objc" and "oop", and everything in "matpak" has to do with "matrix" and "vector". And I think it's fine if matpak's mat-inner-product, which is for vectors, is listed under both "matrix" and "vector". I think using the egg tags (categories) would be sufficient for any future index. Any more granular and there is a high barrier to entry. Users would avoid changing entries for fear of putting something in the wrong category; old hands would get fatigued at choosing topics for every definition. On 2/19/08, Tobia Conforto <[EMAIL PROTECTED]> wrote: > In this spirit, I propose another addition: topics, meaning relevance > to something: > > (stream-xcons a b) > > This would make it possible to build a dynamic index system of all the > definitions (procedures, macros, records...) that have something to do > with consing, and/or with streams, and/or with higher-order procedure > usage or any other topic used in at least one definition. Other > topics could be: list, vector, string, port, networking, html, eval, > threading, fold, map, cgi, timedate... ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] aliases in the wiki
Alejandro Forero Cuervo wrote: I have tweaked a bit the code in Svnwiki a bit to support defining aliases for functions in the wiki. My thinking is that (1) for all procedures f, http://chicken.wiki.br/f should return something useful, regardless of where f is defined and (2) we shouldn't have to duplicate information in the wiki. I agree 100%, but I think this should be done automatically, see my post about automatic index generation from the tags. in those cases in which we have collisions, we can simply create a page listing the multiple possible meanings, something along the lines of: FormatThere are the following pages about this:* Eggs: - format - format-modular * Procedures: - format at the format-modular egg Again, I don't think it should be done by hand, as the potential for mistakes and omissions is huge. Automatic generation will be easy to implement, if/when we tag every procedure definition. For the egg pages we would simply prefix them (so format-modular would become egg-format-modular) This I'm not so sure about, because sometimes you remember the name of a procedure but not its egg, and because usually eggs become part of the domain-specific language you assemble to solve your problem, after which you don't care much anymore which egg the procedures came from. Tobia ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Re: YADT: yet another documentation thread
On 19 Feb 2008, at 5:11 pm, John Cowan wrote: Alaric Snell-Pym scripsit: I'd like to implement this on terms of a FORTH-inspired VM, with implementations of the VM that interpret it or go to native code. I take it you have read http://www.pipeline.com/~hbaker1/ ForthStack.html ? Aye! Good 'ole Henry Baker! He's been quite an inspiration over the years ;-) ABS -- Alaric Snell-Pym Work: http://www.snell-systems.co.uk/ Play: http://www.snell-pym.org.uk/alaric/ Blog: http://www.snell-pym.org.uk/?author=4 ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Re: YADT: yet another documentation thread
Alaric Snell-Pym scripsit: > I'd like to implement this on terms of a FORTH-inspired VM, with > implementations of the VM that interpret it or go to native code. I take it you have read http://www.pipeline.com/~hbaker1/ForthStack.html ? -- John Cowan [EMAIL PROTECTED]http://ccil.org/~cowan Big as a house, much bigger than a house, it looked to [Sam], a grey-clad moving hill. Fear and wonder, maybe, enlarged him in the hobbit's eyes, but the Mumak of Harad was indeed a beast of vast bulk, and the like of him does not walk now in Middle-earth; his kin that live still in latter days are but memories of his girth and his majesty. --"Of Herbs and Stewed Rabbit" ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Re: YADT: yet another documentation thread
On 18 Feb 2008, at 8:05 pm, Mark Fredrickson wrote: I've been looking for my "go to" language for a long time. Ruby was a strong candidate, but Scheme takes what I like about Ruby and gives me more options. I looked at CL but found it weird and inconsistent. The little things matter. Now, I plan to plant myself firmly in Scheme and see where it takes me. I guess I should say that I know I'd like to move on from Scheme one day - but that day won't come until I've been able to implement the thing myself ;-) Pretty close to Scheme, though. Mainly, what I'd change is to slightly extend s-expressions in a subtle way (introducing a special syntax for records plus a means of namespacing symbols, mainly), then drop mutability. Mutability is the main obstacle to really kicking off with some of the more extreme optimisations and interesting metaprogramming systems, and linear logic offers a far cleaner approach to the concept of mutation in a pure functional setting. However, Concurrent Clean, the only really extant linear language at the moment, has a rather ugly syntax for complex multi- step world-mutating operations, something roughly like: someDialogue world::!World -> !World = let world' = print ("Hi, what's your name?" world) in let (world'', name) = input (world') in let world''' = print ("Hello, " . name, world'') in world''' And don't even get me started on what happens when you have multiple linear worldlines interacting. What I propose instead, purely as syntactic sugar all done with macros, is to have an 'algorithm' syntax that wraps a state machine operating on one or more linear values, each of which has a name. Each step in the algorithm is either a function call that may refer to any number, N>=1 of linear state values, referred to by their declared names, in which case the macros enforces that the first N return values from that function are correctly typed to be the new values of those linear state values, with the rest being available for binding to names; or a control flow syntax. The result of the algorithm macro is a function that accepts the initial values of the linear state values and returns the final values, perhaps with extra return values appended. So the above would be more like: (define someDialogue (algorithm (world) (print "Hi, what's your name?" world) (let (name) (input world)) (print (string-append "Hello, " name) world))) ...but I need to experiment a bit to make sure it works properly. Mainly with how the control flow is handled... I'd like to implement this on terms of a FORTH-inspired VM, with implementations of the VM that interpret it or go to native code. Basing it on a FORTHy system means, among other things, that we get the ability to do runtime compilation to native code if so desired: "(lambda (a b c) x)", if x contains d, e, and f as free variables, can just be a macro that expands to "(insert-free-variable-values- into-closure (compile-closure-with-free-variables '(a b c) '(d e f) 'x) d e f)", if the compiler is smart enough to spot that the (compile ...) is a constant subexpression and evaluate it at compile time, even. The compilation process onto my VM would, however, be very similar to how Chicken works, even with a foreign-lambda type construct that lets you write low-level FORTH opcodes or inline assembler (embedded in FORTH) for things that must be speedy. I know I'm losing a lot by not just doing what Chicken does and using GCC, but for various reasons, I want to avoid GCC... But I'm unlikely to have the time to build it for a couple of years yet... So, I guess scheme will do for now ;-) ABS -- Alaric Snell-Pym Work: http://www.snell-systems.co.uk/ Play: http://www.snell-pym.org.uk/alaric/ Blog: http://www.snell-pym.org.uk/?author=4 ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: Snippets wiki (Re: [Chicken-users] My language trajectory)
Hi folks, On Tue, 19 Feb 2008 10:16:07 -0500 "Graham Fawcett" <[EMAIL PROTECTED]> wrote: > On Feb 19, 2008 12:57 AM, Matthew Welland <[EMAIL PROTECTED]> wrote: > > For us learners the best thing the gurus can do in my opinion is to put a > > hierarchy of snippets doing lots of things from simple (even obvious) to > > complex on the Wiki. > > > > I suggest breaking the snippets into four sections: > > > > beginner > > intermediate > > advance > > refugees > >[ section has idioms from other languages and an equivalent in scheme ] > > That is a great idea. There is the Scheme Cookbook site, but it's > heavily weighted toward PLT Scheme. Doing a good job on a cookbook > like that can take some effort, but I'm sure it would be a useful > resource. > > How to start? Maybe adding a section to http://pleac.sourceforge.net would be a good start. Best wishes, Mario ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Re: YADT: yet another documentation thread
On 19 Feb 2008, at 2:13 am, Graham Fawcett wrote: The 6502 was the only CPU I ever really programmed assembly for. I had read about cellular automata (probably Conway's Game of Life, and probably in a Martin Gardner book) Yay for Martin Gardner books! I also learnt a lot of fun things from those :-) ABS -- Alaric Snell-Pym Work: http://www.snell-systems.co.uk/ Play: http://www.snell-pym.org.uk/alaric/ Blog: http://www.snell-pym.org.uk/?author=4 ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Snippets wiki (Re: [Chicken-users] My language trajectory)
On Feb 19, 2008 12:57 AM, Matthew Welland <[EMAIL PROTECTED]> wrote: > For us learners the best thing the gurus can do in my opinion is to put a > hierarchy of snippets doing lots of things from simple (even obvious) to > complex on the Wiki. > > I suggest breaking the snippets into four sections: > > beginner > intermediate > advance > refugees >[ section has idioms from other languages and an equivalent in scheme ] That is a great idea. There is the Scheme Cookbook site, but it's heavily weighted toward PLT Scheme. Doing a good job on a cookbook like that can take some effort, but I'm sure it would be a useful resource. How to start? > I'll happily contribute to the beginner and maybe intermediate > sections. BTW, I'd love it if an expert couple put a handful of > examples that illustrate what cut and cute do. I still don't get it > and the frustrating part is I suspect it will be obvious when I do > :) Since we are not set up yet, I can give an example or two here, and anyone can refine it or paste it into the Wiki later on. Cut and cute are useful for writing short, single-argument procedures. For example, to double the values in a list, you could write: (map (lambda (x) (* x 2)) the-list) But you could shorten it using cut: (map (cut * 2 <>) the-list) where <> is the placeholder for the argument. Cute and cut differ in the way they deal with the *other* arguments in the expression. (cut * foo <>) (cute * foo <>) In the cut form, foo gets re-evaluated every time the procedure is called. In the cute form, foo is evaluated once, and the value is reused upon every call. In other words, cute forms a closure, and the value of foo is captured in the closure when the cute form is initially evaluated. In the interpreter, you can macro-expand the two forms to help remind yourself of which does which: #;1> ,x (cut * foo <>) (lambda (g4) ((begin *) foo g4)) #;1> ,x (cute * foo <>) (let ((g6 foo) (g5 *)) (lambda (g7) (g5 g6 g7))) Note the (let ...) around the (lambda ...) in the cute example: a typical pattern of code that creates a closure. One pattern that sometimes crops up with cut (or with lambdas in general) is a nested-map. Say you have a list of lists, and you want to perform some operation on the sublists: #;1> (define the-list '((1 2) (3 4))) #;2> (map (cut map (cut * 2 <>) <>) the-list) ((2 4) (6 8)) See also left-section and right-section, which have a similar purpose. Note that although 'cut' and 'cute' are plays upon the word 'curry' (as in 'curry upon this'), they are not currying forms, but partial-evaluation forms (sometimes called operator sections). Curry takes a binary procedure and returns a unary procedure that itself returns a unary procedure, e.g. (curry +) => (lambda (a) (lambda (b) (+ a b))) 'curry' is not defined in Chicken, though it would be easy to write. Graham ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Re: YADT: yet another documentation thread
On 18 Feb 2008, at 6:45 pm, Peter Bex wrote: A little painful to admit, but I started out with BASIC on the C64, then got a PC with QBASIC/QuickBASIC, then my first "real" language: C. I stuck with C for a long long time until I learned Scheme at university. That was love at first sight and I've been using it ever since :) PLT first, then a little bit of s48 and then Chicken. I started with BASIC on a ZX Spectrum, thence to Turbo BASIC on a PC (an original PC! Not the XT, which had a hard disk, but a real PC which had to have a 20MB hard disk on a card fitted, and would still only boot from floppy!), then Pascal (again Borland's Turbo version), then to 8086 assembly and C, more or less in parallel. However, I was always taking books out of the library on other languages. The local library was stocked with computer books in the 1970s and early 1980s when new programming languages weren't so stigmatised as they are these days, so I read books on Lisp, FORTH, FORTRAN, COBOL, Prolog and ADA as well as the ones I actually used; but I didn't have any access to implementations. But for my 14th birthday I was gifted with a then-new Demon Internet account, and online, I found myself able to download implementations of more languages, and access to Usenet: comp.lang.* in particular caught my interest. I was confused about this concept of 'functional programming' for a while, since all the descriptions of it I saw made no sense. "Imagine programming without assignment" - uh, how would *that* work? So, for my 16th birthday, I asked my father for a stack of books I'd heard recommendations of but hadn't been able to find. One of which was SICP, which was my first introduction to Scheme. I also picked up a book (well, *the* book, as far as I can tell) on Dylan, since that seemed cool. Anyway, I remember my surprise when, reading SICP, it said "Now we'll cover assignment. What we've been doing so far is called 'functional' programming", or words to that effect, since the way it was done so far had all seemed perfectly sensible to me - I'd not actually noticed the lack of assignment at all... So yes, I liked the look of Scheme; it had a property I had begun to notice in a few languages, that it simple to implement simply, yet didn't preclude more efficient implementation in the way that, for example, TCL with its everything-as-a-string would. This it had in common with FORTH, and FORTH also had the fascinating metaprogramming facility, not unlike defmacro (although I'd not come across macros in the Lisp world at the time, with SICP rather skipping them). However, I didn't have much chance to play with it in depth for a while, since most of the programming I was doing required specific libraries or whatever. Then I went off to University, where I had to pick up a bunch of languages required for exercises: Java, Object- Oriented Turing (a rather toy Modula-esque language), Haskell, a few different assembly languages (as well as using C and Prolog, which I knew anyway, but actually being forced to do exercises in Prolog rather than just reading and thinking about it was a bit of an eye- opener). When it came to final year project time, however, I managed to talk the lecturers into letting me do my own project rather than picking one from their menu. And my project was in macro systems, as I had a cunning plan to try and merge FORTH's metaprogramming system with Scheme, which in effect involved a very low level macro system (I was rather taken with minimalism in programming languages, you see). Meanwhile, I was also working part time, so having to do more serious Java, as well as PHP and a bit of Perl. I picked up Python myself out of interest, since it looked like a better Perl. Only recently did I have to learn Ruby. Ruby's... not *that* bad, it's sort of half way between Python and Perl IMHO. So a bit cleaner than Perl, but still with crufty misfeatures such as "do what I mean" overloading, special core global variables like $_ and $` and all that, regexps in the core language (there's more to life than analysing strings, you know...), and so on. But Rails, however, builds on top of that in entirely the wrong direction, and brings out the worst of it. ABS -- Alaric Snell-Pym Work: http://www.snell-systems.co.uk/ Play: http://www.snell-pym.org.uk/alaric/ Blog: http://www.snell-pym.org.uk/?author=4 ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Topics and a main index (was: egg documentation)
On 2008 Feb 19, at 04:39, Tobia Conforto wrote: Vincent Manis wrote: By the way, on the subject of wiki markup, I'd like to put in a plug for marking index entries. As I see it, with Alejandro's solution we are already marking index entries, at least for procedures, macros, records, and SRFI-39 parameters. On the other hand, the contents of and don't have a fixed syntax that can be easily extracted (they aren't a single s-expr whose car is to be indexed) so maybe an index="" attribute would have its uses, in case the author feels like putting a name for the entry in the aforementioned main index. Or maybe not. If instead you mean index links, as in "this macro is useful in conjunction with [[index:stream-xcons]]", that's a good idea. We could again fix the syntax and use it in the forthcoming documentation review, delaying implementation to when we write the main index itself. That's pretty much where I was going with it. I'm particularly interested in indexing the Chicken manual itself, though the same mechanism is useful for eggs. Automatic indexing is a good start, but there's always a need to add entries manually, for example, List procedures alist-ref append-reverse (SRFI-1) ,,, The same mechanism that makes for a good searchable index a la the CLHS also makes it possible to produce a nice printed index. -- v ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] ANN: new egg, Stacktor
On Feb 19, 2008 9:21 AM, Graham Fawcett <[EMAIL PROTECTED]> wrote: > What I was trying to work out, personally, was a nice way of > transforming a postfix, fixed-arity language into decent > lexically-scoped expressions, e.g.: > > 20 dup print + 30 * > > might translate into > > (lambda (b) (let ((a 20)) (print a) (* 30 (+ 10 b Oops, I meant (lambda (b) (let ((a 20)) (print a) (* 30 (+ a b You can tell I don't have a Quacktor REPL open right now.. ;-) G ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] ANN: new egg, Stacktor
Neat! Mark, you may not believe this, but a few months ago I started writing a stack-based language in Chicken, and the first name I chose for it was 'Quacktor'. Great minds think alike, and fools seldom differ... Also, John Cowan has worked on a Joy egg, if I'm not mistaken; you might find that interesting. What I was trying to work out, personally, was a nice way of transforming a postfix, fixed-arity language into decent lexically-scoped expressions, e.g.: 20 dup print + 30 * might translate into (lambda (b) (let ((a 20)) (print a) (* 30 (+ 10 b ...so that I did not have to maintain an explicit stack, and could get Chicken to compile it to something efficient. It worked out pretty well, IIRC, though my examples were pretty short. I also had a nice SCHEME: form, so you could do stuff like REQUIRE: http-client SCHEME: http-get ( url -- body ) (http:GET url) ; : main "http://callcc.org/"; dup print http-get print ; If you're interested, I'll dig up my notes. Graham ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
[Chicken-users] Re: My language trajectory
> F Wittenberger writes: > OK, here mine > pre-university: > Z-80 machine code (self designed/soldered computer [Screen: 32x8 > characters each 6 bit - save chips save money]; the assembler was me, > manually) Oh, my. [...] So, here's mine (I'm not quite sure about the order, though): * BASIC (MK-85, Sinclair, QuickBasic, probably others); * Assembler (Z-80, x86; both superficial); * Fox-Pro, Pascal, Lisp, Forth (all superficial); * MS-DOS batch files; BASIC (QBasic); * C, Assembler (x86; a more real touch this time); * C++ (superficial); * Bourne Shell (Bash), Perl; * Make, TeX (LaTeX, Texinfo), Sed and Awk (all superficial); * POV-Ray (probably superficial; see, e. g., [1]); * Emacs Lisp (written a never published IRC client for Emacs), Scheme (umb-scheme, scheme48, SLIB); * M4, SQL (PostgreSQL); * PostScript (superficial); * Scheme (Chicken); * GNU Awk and GNU Make (a more real touch); * Tcl (with Tk, Tcl-Nap), Ocaml (superficial), GNU R; * Assembler (AVR; written an ATtiny13-based polyphonic music box and an ATmega48-based frequency meter.) (I deliberately excluded any mark-up languages, such as HTML, as they aren't programming languages.) [1] http://theory.asu.ru/~ivan/graphic/ ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] egg documentation
Alejandro Forero Cuervo wrote: My secret plan is to eventually sneak in support for some ... tags along with the and perhaps tags and then reorganize some of my eggs as wiki pages from which the scm files are generated The horror! :-) Tobia ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] egg documentation
> and look good. The wiki pages use either > '''procedure:''' (proc a b) or > [procedure] (proc a b) > > depending on the author, so the rendering is up to you. Alright. I suppose I'll highlight the procedure name and make sure it gets typeset in monospaced font, as: [procedure] {{('''proc''' a b)}} Based on your description, param, read, record and signature sound worth supporting as well. (My secret plan is to eventually sneak in support for some ... tags along with the and perhaps tags and then reorganize some of my eggs as wiki pages from which the scm files are generated, but please don't tell anyone!) Alejo, Literate Programming Fan http://azul.freaks-unidos.net/ ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] My language trajectory
OK, here mine pre-university: Z-80 machine code (self designed/soldered computer [Screen: 32x8 characters each 6 bit - save chips save money]; the assembler was me, manually) Basic (Comodore C16) FORTH (written be myself with the build in 5026[or something] assembler of the C16) A real assembler for the C16, which I used to write a different FORTH Pascal university: Modula-2 VMS assembler C C++ Prolog traces of Lisp Unix/Linux traces of Perl post graduate: SGML Scheme slim traces of ML VHDL Verilog LaTeX, Lout DSSSL XSLT some Python > At work I'm writing a lot of Java and XSLT (factlet of the day: you > can write entire web applications in XSLT; You can www.dla-compro.de is no plone. It's Scheme+XSLT+CSS+JavaScript. (On top of askemos.org - a p2p network). > no, I wouldn't recommend doing it :-) I would. But don't ask me. Ask the develpers how long it took them. (They knew both before had a choice: write essential modelling code for askemos but use it as data base only and utilize something like plone as middle tier between the data base and the browser. They choose the alternative: drop plone and python; do it native.) /Jörg ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
[Chicken-users] passing variable number of floats to C
Hi if i have a scheme function that accepts a variable number of float arguments what is the best way to pass the floats to C? ie: (define (pass-floats . floats) (let ((len (length floats))) (my_c_function len (list->*float floats)) )) how do i get the behavior of list->*float ? thanks for any tips! best rick ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
[Chicken-users] Topics and a main index (was: egg documentation)
Jim Ursetto wrote: (string-set! a b) (args:make-option (OPTION-NAME ...) ARG-DATA [BODY]) hostinfo eggdoc:doctype @[object message: value ...] doctype:xhtml-1.0-strict I like this solution! It's a good compromise between plain, un- indexed Wiki pages and a complete documentation rewrite in a domain- specific language (which, although technically better, I agree would thwart user contributions.) I hope you are planning to build a "main index" of all definitions, by symbol and by permuted symbol? (see for example the indexes in CL Hyperspec) IMHO this would be the best benefit of introducing this syntax. I will gladly contribute code, once we decide to start working on it. In this spirit, I propose another addition: topics, meaning relevance to something: (stream-xcons a b) This would make it possible to build a dynamic index system of all the definitions (procedures, macros, records...) that have something to do with consing, and/or with streams, and/or with higher-order procedure usage or any other topic used in at least one definition. Other topics could be: list, vector, string, port, networking, html, eval, threading, fold, map, cgi, timedate... The topic index system can be written later, but I think it's important to get the attribute ready for the hackaton, if we agree it's a good idea. Meaning, let's define a list of basic topics and commit to put them on every definition we touch, if and where appropriate. With these semantic additions, I think the wiki repo could be considered the main source of documentation. Package builders will just have to checkout both the egg repo and the wiki repo, and run some scripts to generate the most recent documentation in various formats. Vincent Manis wrote: By the way, on the subject of wiki markup, I'd like to put in a plug for marking index entries. As I see it, with Alejandro's solution we are already marking index entries, at least for procedures, macros, records, and SRFI-39 parameters. On the other hand, the contents of and don't have a fixed syntax that can be easily extracted (they aren't a single s-expr whose car is to be indexed) so maybe an index="" attribute would have its uses, in case the author feels like putting a name for the entry in the aforementioned main index. Or maybe not. If instead you mean index links, as in "this macro is useful in conjunction with [[index:stream-xcons]]", that's a good idea. We could again fix the syntax and use it in the forthcoming documentation review, delaying implementation to when we write the main index itself. Tobia ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] new domains.
On Feb 18, 2008 9:03 PM, Elf <[EMAIL PROTECTED]> wrote: > > if you cant fix it on webserver end, we have some potential fixes on this end > but it would be a lot more work for the Very Nice Person who has been handling > dns issues since the computer fire. You could just redirect them all to http://chicken.wiki.br. cheers, felix ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] new domains.
On Feb 18, 2008 8:59 PM, Peter Bex <[EMAIL PROTECTED]> wrote: > On Mon, Feb 18, 2008 at 11:49:15AM -0800, Elf wrote: > > > > www.. are all now cnames for > > www.call-with-current-continuation.org ... which isnt working too hot. > > > > advice please? > > Looks like call-cc's vhosting isn't set up to dispatch those domains. > Felix: Can you fix this on the webserver end? > Sorry, I just have ftp access and can't do anyhing about it. cheers, felix ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] My language trajectory
Here's mine! @ pre-university: IBM PC BASIC (yay!) Pascal C++ Javascript @ uni: learned C properly Java SQL some kind of assembly traces of ML and Lisp most notably, the University environment introduced me to Linux, with bash, regexps, sed, awk, perl... @ post uni: Python CL Scheme (in this order) At work I'm writing a lot of Java and XSLT (factlet of the day: you can write entire web applications in XSLT; no, I wouldn't recommend doing it :-) but I too plan on sneaking in Chicken in the coming projects! Tobia ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] egg documentation
and look good. The wiki pages use either '''procedure:''' (proc a b) or [procedure] (proc a b) depending on the author, so the rendering is up to you. On 2/19/08, Alejandro Forero Cuervo <[EMAIL PROTECTED]> wrote: > > eggdoc:doctype > Is this meant to be used as in "The procedure sets the contents of the > string a to a copy of the contents of > b"? No. To define a SRFI-39 parameter. It would expand to [parameter] '''eggdoc:doctype''' according to your expansion of proc/macro. For parameters a procedure syntax should be accepted as well, e.g. (eggdoc:doctype TYPE). > > hostinfo > > doctype:xhtml-1.0-strict > Care to give me an example as to how these are used and what you think > they should expand to? I'm not completely sure I understand their > semantics. Same thing. Semantics are they introduce a definition, not that they are used whenever this type is encountered in the text. Check out any of the existing eggs, such as objc: @[RECEIVER KEYWORD ARGUMENT ...] '''read-syntax:''' @[RECEIVER KEYWORD ARGUMENT ...] objc:instance '''record:''' objc:instance doctype:xhtml-1.0-strict '''string:''' doctype:xhtml-1.0-strict This is so that symbols/variables other than procedures and macros can be automatically indexed. Compare @deffn / @defmac / @defspec / @defvr / @defvar in Texinfo, which serve a similar purpose. In other words, these tags are 'definition commands'. ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] egg documentation
> So ultimately, I think something like the following tags would be useful: Thanks for the list! :-) > (string-set! a b) Alright, I will simply expand this to: [procedure] {{('''string-set!''' a b)}} > (args:make-option (OPTION-NAME ...) ARG-DATA [BODY]) I'll expand this to the same as the above, but with “macro” instead of “procedure”. > eggdoc:doctype Is this meant to be used as in “The procedure sets the contents of the string a to a copy of the contents of b”? In this case I don't think we should support it. I think it makes things way too verbose for what it gets us. The crucial thing to remember is that we want a compromise between having some semantics and still making it easy for anyone to edit this code. > hostinfo > @[object message: value ...] > doctype:xhtml-1.0-strict Care to give me an example as to how these are used and what you think they should expand to? I'm not completely sure I understand their semantics. Alejo. http://azul.freaks-unidos.net/ ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users