Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

how to call HELP on an object method ?

 [1/4] from: rebol::meurrens::org at: 23-May-2003 11:00

Hello all, I want to document properly my REBOL objects... But is it easely usable? Any idea on how to call HELP on an object method ??? f1: function [ "help on f1" ][][ print "I am f1" ] help f1 o: make object! [ m1: function [ "help on m1" ][][ print "I am m1" ] ] ;;;;; help o/m1 ;;; how to do this ???? o/m1 is a path .... I can of course do: o: make object! [ help-m1: does [ help m1 ] m1: function ["help on m1"][][ print "I am m1" ] ] o/help-m1 but this is not very neat... not very standard... and this forces to add an additional help method for each documented method.... Any idea ? I found nothing in the nice FAQ's maintened by some of you... Thanks... Regards, </marc> Prof. Ir Marc Meurrens, Brussels (be) TEL: +32 (0)2 537 2812 FAX: +32 (0)2 537 7645 EMAIL: [marc--meurrens--org] URL: REB: PGPKEY: Please don't mail me attached files, instead, use my 'exchange area' : EXCHANGE AREA: (HTTP/FTP upload/download of temporary/persistent files)

 [2/4] from: greggirwin:mindspring at: 23-May-2003 11:10

Hi Marc, MM> Any idea on how to call HELP on an object method ??? There are a number of ways you could approach this. A simple one would be: obj-help: func [word] [help :word] obj-help in o 'm1 Another way, that I have played with, for use in a general set of objects used as a library, is to define a HELP function in a prototype object and let all the others use that. REBOL [ Title: "lib-kernel" Author: "Gregg Irwin" Email: [greggirwin--acm--org] Version: 0.0.1 Comment: {Base object for libraries.} ] lib-kernel: make object! [ ;-- This is used to make the help functions in the sub-libraries. ; They can redefine it, of course, but this gives us a base of ; functionality. ?: help: func [ "Shows help for the object." /with "Means you want help for one, specific word." word "The word you want help for." /local value ][ either with [ value: in get 'self :word either none? :value [print rejoin [:word " is not a word in library."]] [system/words/help :value] ][ ;?? It might be better to show just the interface for each ; function and/or an overview help text for the object. foreach word help-words [ ; a) ;value: in get 'self :word ;system/words/help :value ; b) print either function? value: get in get 'self word [ [word mold third :value] ][ [word mold :value] ] print to-string array/initial 66 "-" ] ] ] ;-- List of words defined in the object. words: does [next first self] ;-- By default, help will return help for all words in the object. ; You can override this to show help for just a subset of words. help-words: :words ] Then you just do this: obj: make lib-kernel [ m1: function [ "help on m1" ][][ print "I am m1" ] ] obj/help ; prints help for all methods in obj obj/help/with 'm1 ; prints help just for m1 You could also modify the standard HELP function to allow use of paren! values or something, or build a special function and dialect for getting really specific control. HTH! -- Gregg

 [3/4] from: brett:codeconscious at: 24-May-2003 11:10

> I want to document properly my REBOL objects... > But is it easely usable?
I've been using Nenad Rakocevic's help.r for a long time now. I don't know where to point you to download it so I've included it here as a compressed string. DECOMPRESS the string below, write it to a file and have a look at it. Regards, Brett. #{ 789CA559696FE34612FD1CFE8A1681853D4024D90136C07277E2F578E48C1789 3DF0B1FB81E0002DB229714CB19566D31A27C87FDFAAEA83A7E7403C8025F751 C7ABAAD7D53DB7622D4B16070C7EEE0B5D8A8885AB4F5A5499C8D83B51EE439A 3A6FF4562A98BB1615CFD82D7F94A9782A5233BBDAF1A28C5826D3C762B716E5 BF7325C4225734F9966B107AF28FF94DAAE73F9C9C9CD0E86581AAFEB6050D0B 157CF74EEEE0CFADD6FB68B9DC0910A2EA45B54E8B452A77CBF32A53E2F02B57 BAA896B768F1F23DD7E956D4CBE0BB6B8E5B8F9CD173349A54D092C999FF82F4 4256113B5D9C2C4E69E85D516BA99E230B054D748D6634CCD81F6CCE2AAE8B27 3163BCCA184F35489AB1275E36A26607A1043B28596DCA67A6C45E2A0D381615 FBDFCDEDDB3BF8526BC13392257376F9707D717F75737DB7003C3E896C4113F4 6BCE1EAA5AE819CBB8E6FA790F52795D1D69B605AD25C84CA55222D5A006A41F 9560FE5CAE3F5A41EC50E82DC939DA08BDE4D5B3538D6A716CF167AB0B9D3D61 273F4E387B59A85A8323A5E0B56033B32931F0366A2F6B80FE0F02180145E17A 2BD81186152CDCED10A25C2AB6165A0BC5C042B079C6EA668FD090B80B58262A 0D72F0AF7BF50C228A9A813414E584944525225C10F088EDF8A3F0B2E2208D58 DE54298BC3BD2A2ACD38DB89BAE61B1126313343E1D5D18EA508159F85E0C07A 2424F34214C2C421946BB64721A8FB91C58D2A678917488B6822090083BF0709 FC0BC86F6E3F96A9FBB2F65F9659FB5504C1B36C58CAC1A8B2964C83EB6B250F 75516DC8F7FA1942B6B3365248596475D8A97FE2BA8A76D2B0056D03E959B183 5459FD3D60BD9E1B1135652C7A89395B07C1AAFA282133349B0526B21750AB1B 2A03C8914A285EA257A4D2C143EBC2F708420D784270771CC531BE968D364A49 8FA988456892E90827580C9938C76C9E25667859CA9497662DE36A0322D1AF0A 6A1A20CE7732130CD78348AD55CD14954251A147ACE64F50D566AFF94E4A5C2D 048931B6C85983B574C65C2D58636C96331B52AD8ADD92375A42267E989B7FF7 802621EB5083B5F2A9C8D0205617BB7D898509292B51B8DFF615B840AA4BD640 5115ED362C0B28684EAB19948DC50551A9119E862AC5AFF75F3ECCC948A871A1 F470342FAA2C683D92ECA9100748B9D21AA5B75C4335005982E63DC742ADA260 282584996D381CD572FE39D1C00700D35EA4455E002B392E1B4BB7943A1C761B 6641372240B14010543304147004C481C0CE95DC7579C36F43FE40CC317D38CB C1CA74CB9589C85E015DB0FBF33718462B4CF89D280DD5C0EEAB9C5512D809EA 73CBF77B20BDEF5199B16727E113B0ACFC4E59999D1D8429F0AB4A369BAD3300 765542C0F9D46A84C4A88ADF1A81E49E41C48BFC9979335A286E5037E650DE94 6D59F7C035C937270EB6154D45DB59D22053DA2543C6F53957773694450A9E77 B740C6EC28D8608B6276BEB3A3968D4A852190B9AD36378686115D3907BAA6ED 378A67A8A9D9432A40D101612AB070FF8CDA6E576F6E7E1917C32588A46074AA 10685008B2954CDC3458C20BBBE54FE699407C8272A4338E39EEC06C8E11F933 16513421054C61DA81C44CC38922CBCC0DF9DD4037710DD4526DDCFE914097E5 44505640D2A12722C0C8B81D27ADB144891178964A8897391296A6F0FC1A4040 70A86CA2D59C4EF3DEC2560BFE905B5653C87A3F21EBAD84E4AD206D0C414524 BD37EF8043B02CFB1AED86C70336F8219C46A3348362FA0822A359D51DB42737 A2FEFEE609B4D9B1FFFA8ABD6666B6636E3292DF1F49264C87E64F782BE3901D 8763B92C7C154E184FD492D9738F040CB4F5FEB45950894F566A30B1B0866ECB 0AF46305B11913BBBD7E3EB3937D3F6CEF74291B3407C8CBE05D478364E82599 1564F6C69AAF69381958ED0B6D60A8DD165ECB5E7321ABD05069784C1F5B3813 2B69C0E961382C60B4665ED115C1F42FB4A51B309BF354BC264291099A5F9142 F70B2D2C4F1F99868B0E1B4C7F94D0568A82C8983233E4A2904D6823ED3200DA 3C30143EF1A38DAAB5937EB9CEC5D98A4D4E6C5BD4C4F54AB4E8603EE004A4CF 1C7A91DF058CD2476EABBDA95839C7DFC07529F9663B2207F2CD9BFFAC2EEE21 9A86735A1B0E9E6DDAB15A4E0CE6FD31634564CD805B5F304A0FCA444A56030F F96896357023232AA13F2DA2D831BAA3A1EDE00071DC18A177B10F74E40F9199 C1B63BE56B7E28A073A721B822568A6AA3B7672627DC8A1A1AF074BBCC44CE9B 52B7F9E25A621BA7109A5C53BF2E4220C0480FBD75A1DDD45D997B4D5098266E 3FB978C60E501A4F3A162763418717051DACA0C394A04E66841F96745F8DC26E 242C51581D716FFDFCB8826EE755E86C7221A71C741B70B16104072C68459E84 EEC8E4863172CE8E8711786508054EA13009DC0D8C0A8FE48573D8734F610E5F 0E34D16DE0DCF5AEDE3DBC999B4A4087279C8518C6C1C8D3292F716587F85A37 51AD57E8AFFD2FE39B7F2BBEF957E39B7F115F6B8F3B36913D22B62F90FEB605 90EF14B4A71EA2615C421290205EDE1B0C179C2932A5E652640867D086C613A2 43E6B78697678E9DE900C0DBC8CC82D4DEFD22331B74781D6E2865A1E7B8DE4F 9AFB63E4AAC63018B600459580FD59038D698CA3CB3D578EC13D66E6D001144F 99D1695598CB2777949FB812144A49754697F4B873658D9C8599B406995AB620 AD705764DE428A9A4E6A8E3B0AE33B9BD9DCF1E79D57D703CBD8DE3E73748F19 3B3B90C3BABCE290C2EC0B6CC3D06D5D5D4CE3B6F765615187EDB9EB1B62D200 9FD66B849B963BBB8D8DDEE481A95396E2DB84B5A97F4A7811D638B8560B95E2 0B16993969A5D912C2B5C21818DA76DEF60BDE7C43B76A5347B61ABADD82A9A1 87BBF39F57D187E58779E8BD4323E5BE358D56DAFC9B348FB9AEE6B02D4A611A 59EC3ECE4879B781C1D28E5C5B894F28DD0ECFB4E6AF5DF310AF81371E93DE12 6ABDA95946146D74CD330C36CF4277C7B03EA0C91158B77E68DC353AD70C8624 2C1C5E2130E6DF8688AB18CCC6B603EFDE88282EA61586AFDD84B665656D300B B7F4D2E721B36C83D2CFDC1B533C48D7C40D449D52EE309627F9B7ABBB8BDBAB F7C8F3AE5D1EF02A312A693F1DBD45117B76425A8903DDC771F81BB2993E16E1 17111AAAC70367C0CF1D2821706B48A7C7975CB03792A98CFC4C80406A9BDF2C C67AFBEB1530D0F74DA5E1D3418F737E90F2E68EDAAF142FDFD8152BA11B5545 89C3AE63AEB2CDAB1F4946956292D23D898EAF9B3EEFCE6F7F7EF875758DBDCC F86669F747ECC8A3EF7EBAF5140FB53BBDFFFA891DC1F7E13DB167C0EDEAF2EA 7AF51526A0A0174D1846E14B1118F43E8697866E4C569ED919B2F93CEC456090 3A03698E4E3E87DAD773EA18CE0EE8AF1DE66429B838F164D0BA6FC9161BAF89 75F629E9850A1E568B81832EBE13107C19D44E8A87E19710B5E2A8CACD138235 F608207CC965D76C86BDEEFFA5879551D0287041FF5B4B47E63F1B5C434FA97D FF700B6DBB39DA693A69979B279D31952E8FEFDEAF2EAECE7F61E7F7F7B7576F 1EEE5777AF3A9531A6377A739A7E9A7BF1116DF40C347E8FF399D8EDB0469052 16B9AE672240FD7893A6D30959AD3C2C2D16F6DED35E78B07BF125CB47E8AFC5 D4F470C1FF01D9DA24E4F41E0000 }

 [4/4] from: nitsch-lists:netcologne at: 24-May-2003 3:54

Marc Meurrens wrote:
>Hello all, > >I want to document properly my REBOL objects... >But is it easely usable? >
Yes :)
>Any idea on how to call HELP on an object method ??? >f1: function [ "help on f1" ][][ print "I am f1" ]
<<quoted lines omitted: 3>>
>] >;;;;; help o/m1 ;;; how to do this ???? o/m1 is a path ....
?>> o: make object! [ [ m1: function [ "help on m1" ][][ print "I am m1" ] [ ] ?>> ?>> help o ; <<<< :) :) O is an object of value: m1 function! help on m1 If you have nested objects, or really want help for only that function, ;make object-path[help word-in-object] ?>> make system/view[help vid]
>I can of course do: >o: make object! [
<<quoted lines omitted: 19>>
>EXCHANGE AREA: >(HTTP/FTP upload/download of temporary/persistent files)

  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted