Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.sys.acorn.programmer > #914
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!feeder.news-service.com!border3.nntp.ams.giganews.com!Xl.tags.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!local2.nntp.ams.giganews.com!nntp.brightview.co.uk!news.brightview.co.uk.POSTED!not-for-mail |
|---|---|
| NNTP-Posting-Date | Mon, 24 Oct 2011 04:07:58 -0500 |
| Date | Mon, 24 Oct 2011 10:07:24 +0100 |
| From | Gavin Wraith <gavin@wra1th.plus.com> |
| Newsgroups | comp.sys.acorn.programmer |
| Subject | Re: BBC BASIC, EVAL and PROC |
| Message-ID | <eb211e2752.wra1th@wra1th.plus.com> (permalink) |
| References | <mpro.lthf260531xnk01ej.news@stevefryatt.org.uk> <mpro.ltj5ao09mmcog01il.news@stevefryatt.org.uk> |
| Organization | Home |
| User-Agent | Messenger-Pro/1.00c (MsgServe/1.00a) (RISC-OS/5.16) NewsHound/v1.50-32 |
| Lines | 33 |
| X-Usenet-Provider | http://www.giganews.com |
| X-Trace | sv3-gnhWo5fd10SlfTry19hN7UptE2fMVR8jL6+5dOtIzM5do4ls9IlxjAHai9sB78FEOwU0b8ZxeNovN5N!LE/N6XZmICoKOQtB+ivBS6e8nYv0sA0WdMUKWZo24/AaBBuqPwmGDDMYc26A18Cd4I4YEkJGlErr!HaRQ |
| X-Abuse-and-DMCA-Info | Please be sure to forward a copy of ALL headers |
| X-Abuse-and-DMCA-Info | Otherwise we will be unable to process your complaint properly |
| X-Postfilter | 1.3.40 |
| X-Original-Bytes | 2066 |
| Xref | x330-a1.tempe.blueboxinc.net comp.sys.acorn.programmer:914 |
Show key headers only | View raw
In message <mpro.ltj5ao09mmcog01il.news@stevefryatt.org.uk>
Steve Fryatt <news@stevefryatt.org.uk> wrote:
> You can't call procedures that don't exist,
Excuse the peripheral relevance. RiscLua does not have a CASE statement
but you can fake one with
CASE = \(list_of_procs,defaultproc) => \(code,...)
local action = list_of_procs[code]
if action then
=> action(...)
else
=> defaultproc(...)
end end end
which copes nicely with procedures with indeterminate
numbers of parameters and undefined procedures. Thus, for example
wimp_case = CASE (event_handlers, do_nothing)
repeat
reason_code = sys ("Wimp_Poll",mask,message_block)
result = wimp_case (reason_code,message_block, user_parameters)
until exit(result)
shows how the CASE structure can be lifted out of the polling
loop. Incidentally, the "..." is the Lua syntax for an indeterminate
number of parameters, not metasyntax.
--
Gavin Wraith (gavin@wra1th.plus.com)
Home page: http://www.wra1th.plus.com/
Back to comp.sys.acorn.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
BBC BASIC, EVAL and PROC Michael <michaelremerton@gmail.com> - 2011-10-22 11:15 -0700
Re: BBC BASIC, EVAL and PROC Steve Fryatt <news@stevefryatt.org.uk> - 2011-10-22 20:20 +0100
Re: BBC BASIC, EVAL and PROC Michael <michaelremerton@gmail.com> - 2011-10-22 12:54 -0700
Re: BBC BASIC, EVAL and PROC Steve Fryatt <news@stevefryatt.org.uk> - 2011-10-23 18:44 +0100
Re: BBC BASIC, EVAL and PROC Michael <michaelremerton@gmail.com> - 2011-10-23 12:45 -0700
Re: BBC BASIC, EVAL and PROC Gavin Wraith <gavin@wra1th.plus.com> - 2011-10-24 10:07 +0100
Re: BBC BASIC, EVAL and PROC jgh@arcade.demon.co.uk (Jonathan Graham Harston) - 2011-10-23 19:13 +0100
Re: BBC BASIC, EVAL and PROC Michael <michaelremerton@gmail.com> - 2011-10-23 12:50 -0700
Re: BBC BASIC, EVAL and PROC Steve Fryatt <news@stevefryatt.org.uk> - 2011-10-23 22:00 +0100
Re: BBC BASIC, EVAL and PROC Martin <News03@avisoft.f9.co.uk> - 2011-10-24 18:23 +0100
Re: BBC BASIC, EVAL and PROC Steve Drain <steve@kappa.me.uk> - 2011-10-24 13:34 +0100
Re: BBC BASIC, EVAL and PROC Rick Murray <heyrickmail-usenet@yahoo.co.uk> - 2011-10-25 07:34 +0200
Re: BBC BASIC, EVAL and PROC Nick Roberts <tigger@orpheusinternet.co.uk> - 2011-10-25 18:14 +0100
Re: BBC BASIC, EVAL and PROC Rick Murray <heyrickmail-usenet@yahoo.co.uk> - 2011-10-26 06:32 +0200
Re: BBC BASIC, EVAL and PROC druck <news@druck.org.uk> - 2011-10-26 10:51 +0100
Re: BBC BASIC, EVAL and PROC Rick Murray <heyrickmail-usenet@yahoo.co.uk> - 2011-10-26 19:15 +0200
Re: BBC BASIC, EVAL and PROC "Ste (news)" <steve@revi11.plus.com> - 2011-10-26 15:09 +0100
Re: BBC BASIC, EVAL and PROC "John Williams (News)" <UCEbin@tiscali.co.uk> - 2011-10-26 16:36 +0200
Re: BBC BASIC, EVAL and PROC Rick Murray <heyrickmail-usenet@yahoo.co.uk> - 2011-10-26 19:18 +0200
Re: BBC BASIC, EVAL and PROC Nick Roberts <tigger@orpheusinternet.co.uk> - 2011-10-26 17:26 +0100
Re: BBC BASIC, EVAL and PROC "Ste (news)" <steve@revi11.plus.com> - 2011-10-26 21:07 +0100
Re: BBC BASIC, EVAL and PROC Gerph <gerph@gerph.org> - 2011-10-25 03:28 -0700
Re: BBC BASIC, EVAL and PROC Ron <beeb@woosh.co.nz> - 2011-10-27 11:52 +1300
Re: BBC BASIC, EVAL and PROC Theo Markettos <theom+news@chiark.greenend.org.uk> - 2011-10-27 12:00 +0100
Re: BBC BASIC, EVAL and PROC Ron <beeb@woosh.co.nz> - 2011-10-28 01:38 +1300
Re: BBC BASIC, EVAL and PROC Theo Markettos <theom+news@chiark.greenend.org.uk> - 2011-10-27 14:02 +0100
Re: BBC BASIC, EVAL and PROC Rick Murray <heyrickmail-usenet@yahoo.co.uk> - 2011-10-27 18:24 +0200
Re: BBC BASIC, EVAL and PROC Rick Murray <heyrickmail-usenet@yahoo.co.uk> - 2011-10-27 07:42 +0200
Re: BBC BASIC, EVAL and PROC Steve Drain <steve@kappa.me.uk> - 2011-11-03 13:57 +0000
Re: BBC BASIC, EVAL and PROC Tony van der Hoff <news1106@vanderhoff.org> - 2011-11-03 15:28 +0100
Re: BBC BASIC, EVAL and PROC Steve Drain <steve@kappa.me.uk> - 2011-11-03 16:00 +0000
Re: BBC BASIC, EVAL and PROC Gerph <gerph@gerph.org> - 2011-11-04 16:22 -0700
Re: BBC BASIC, EVAL and PROC Steve Drain <steve@kappa.me.uk> - 2011-11-05 14:51 +0000
Re: BBC BASIC, EVAL and PROC Steve Drain <steve@kappa.me.uk> - 2011-11-06 13:25 +0000
Re: BBC BASIC, EVAL and PROC Rick Murray <heyrickmail-usenet@yahoo.co.uk> - 2011-11-06 19:35 +0100
Re: BBC BASIC, EVAL and PROC Alan Adams <alan@adamshome.org.uk> - 2011-11-06 18:53 +0000
Re: BBC BASIC, EVAL and PROC Gavin Wraith <gavin@wra1th.plus.com> - 2011-11-07 14:09 +0000
csiph-web