Changeset 37688 in project


Ignore:
Timestamp:
06/11/19 10:36:58 (6 days ago)
Author:
wasamasa
Message:

Port guide to C5

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/chicken-for-emacs-lisp-programmers

    r36801 r37688  
    1919be {{cl-lib}} and [[https://github.com/magnars/dash.el|dash.el]], to
    2020get a taste of what's possible with CHICKEN, check out the
    21 [[http://wiki.call-cc.org/chicken-projects/egg-index-4.html|egg
    22 index]], specifically the "Language extensions", "Logic programming"
    23 and "Object-oriented programming" sections.
     21[[http://wiki.call-cc.org/chicken-projects/egg-index-5.html|egg
     22index]], specifically the "Language extensions" and "Object-oriented
     23programming" sections.
    2424
    2525== Lisp-1 vs. Lisp-2
     
    9696you do need variables that behave as if dynamically bound, you can use
    9797the {{fluid-let}} macro or better, define
    98 [[http://api.call-cc.org/doc/chicken/parameters|parameters]].
     98[[http://api.call-cc.org/5/doc/chicken/base#sec:Parameters|parameters]].
    9999
    100100== Truthiness
     
    139139the CHICKEN equivalent is {{begin}}.  If you ever feel like you need
    140140{{prog1}}, either use {{begin0}} from the
    141 [[http://api.call-cc.org/doc/miscmacros#def:begin0|miscmacros]] egg or
     141[[http://api.call-cc.org/5/doc/miscmacros|miscmacros]] egg or
    142142{{(let ((result (first-form))) ... result)}}.
    143143
     
    153153specified by the {{else}} keyword.  Furthermore, it's possible to
    154154transform the result of a test with the {{=>}} syntax, see
    155 [[http://wiki.call-cc.org/man/4/The%20R5RS%20standard|R5RS]] for
    156 further details.
     155[[http://wiki.call-cc.org/man/5/Module%20scheme|R5RS]] for further
     156details.
    157157
    158158=== Specialized conditionals
     
    168168
    169169Emacs Lisp has {{pcase}} whereas CHICKEN has
    170 [[http://api.call-cc.org/doc/matchable|matchable]].  Make sure to
     170[[http://api.call-cc.org/5/doc/matchable|matchable]].  Make sure to
    171171check out
    172172[[http://ceaude.twoticketsplease.de/articles/an-introduction-to-lispy-pattern-matching.html|Moritz
     
    212212Consult the following before rolling your own:
    213213
    214 * [[http://wiki.call-cc.org/man/4/The%20R5RS%20standard|The R5RS
     214* [[http://wiki.call-cc.org/man/5/Module%20scheme|The R5RS
    215215  standard]]
    216216* [[https://srfi.schemers.org/srfi-1/srfi-1.html|SRFI-1]]
    217 * [[http://wiki.call-cc.org/man/4/Supported%20language|Extensions and
    218   built-in units]], especially the data-structures unit
    219 * [[http://wiki.call-cc.org/chicken-projects/egg-index-4.html|The egg
     217* [[http://api.call-cc.org/5/doc/chicken/modules/included|Built-in modules]]
     218* [[http://wiki.call-cc.org/chicken-projects/egg-index-5.html|The egg
    220219  index]]
    221220
     
    240239instantiation.  It's possible to use extra qualifiers to selectively
    241240import or rename identifiers, see
    242 [[http://wiki.call-cc.org/man/4/Modules#import|the manual]] for
     241[[http://api.call-cc.org/5/doc/chicken/modules|the manual]] for
    243242details.
    244243
     
    271270task.  CHICKEN's closest thing to this is the ports abstraction used
    272271for I/O, be it with strings, files, sockets, whatever.  Refer to
    273 [[http://wiki.call-cc.org/man/4/The%20R5RS%20standard#input-and-output|The
     272[[http://wiki.call-cc.org/man/5/Module%20scheme#input-and-output|The
    274273R5RS standard]] for details.
    275274
     
    284283  close to Emacs modules, but much nicer because you don't have to
    285284  write the whole thing in C.  You'll want to study
    286   [[http://wiki.call-cc.org/man/4/Interface%20to%20external%20functions%20and%20variables|the
     285  [[http://wiki.call-cc.org/man/5/Interface%20to%20external%20functions%20and%20variables|the
    287286  manual]] for this and check out the {{foreigners}} and {{bind}}
    288287  eggs.  The {{lazy-ffi}} egg is another option if you prefer runtime
     
    303302syntax-rules primer]] covers intermediate and advanced usage.
    304303Additionally to that CHICKEN comes with
    305 [[http://wiki.call-cc.org/man/4/Macros|explicit and implicit renaming
    306 macros]] that allow you to inject identifiers on an opt-out or opt-in
    307 basis.  [[http://wiki.call-cc.org/explicit-renaming-macros|Here's
    308 another tutorial]].
     304[[http://wiki.call-cc.org/man/5/Module%20(chicken%20syntax)|explicit
     305and implicit renaming macros]] that allow you to inject identifiers on
     306an opt-out or opt-in basis.
     307[[http://wiki.call-cc.org/explicit-renaming-macros|Here's another
     308tutorial]].
    309309
    310310You might be wondering now whether to bother writing Scheme macros at
     
    324324
    325325* Basic REPL ({{csi}}), optionally with readline-style editing:
    326 ** [[http://wiki.call-cc.org/eggref/4/parley]]
    327 ** [[http://wiki.call-cc.org/eggref/4/linenoise]]
    328 ** [[http://wiki.call-cc.org/eggref/4/readline]]
    329 ** [[https://github.com/wasamasa/readline]] (cleaner alternative to the previous one with better tab-completion)
     326** [[http://wiki.call-cc.org/eggref/4/parley|parley]] (to be ported)
     327** [[http://wiki.call-cc.org/eggref/5/linenoise|linenoise]]
     328** [[http://wiki.call-cc.org/eggref/5/breadline|breadline]]
    330329* [[http://www.more-magic.net/posts/statistical-profiling.html|Two profilers]]
    331 * [[http://wiki.call-cc.org/eggref/4/chicken-doc|Documentation look-up]]
     330* [[http://wiki.call-cc.org/eggref/5/chicken-doc|chicken-doc]]
    332331* The {{feathers}} debugger: [[http://lists.gnu.org/archive/html/chicken-hackers/2015-11/msg00044.html]]
    333332
     
    338337People seeking for a more IDE-like experience are encouraged to give
    339338[[https://github.com/jaor/geiser|Geiser]] or the
    340 [[http://wiki.call-cc.org/eggref/4/slime|slime egg]] a try.
     339[[http://wiki.call-cc.org/eggref/4/slime|slime egg]] (to be ported) a
     340try.
    341341
    342342== Application/library development
     
    347347especially if you need to reference resource files.  In this situation
    348348it can be of advantage to structure your application as an egg and use
    349 {{chicken-install}} to install it.  Deployment can be made to work,
    350 but is awkward, especially if it's of the static kind and external
    351 libraries are involved as every dependency needs to be built
    352 [[https://www.foldling.org/scheme.html#compiling-statically-linked-chicken-scheme-programs-with-extensions|the
    353 same way]].  This will hopefully be easier to do in the upcoming major
    354 release of CHICKEN.
     349{{chicken-install}} to install it.  Static linking got easier in
     350CHICKEN 5 as the entire system and eggs are built both in dynamic and
     351static versions.  The only issues you'll be running into is
     352bindings to external libraries.
    355353
    356354The vast majority of eggs consists of libraries pulled in from
     
    376374
    377375CHICKEN's community is considerably smaller, but more welcoming.
    378 [[http://wiki.call-cc.org/chicken-projects/egg-index-4.html|The egg
     376[[http://wiki.call-cc.org/chicken-projects/egg-index-5.html|The egg
    379377index]] serves as the central hub where one can install eggs from.  If
    380378you encounter an egg outside it or write your own, you can simply run
Note: See TracChangeset for help on using the changeset viewer.