I have the following code
renderAttendeesOn: html self workSession attendees do: [:each | html text: each person displayString] separatedBy: [html text:'; '.] if there is no attendees for my worksession, it needs to display : NO ABSENTEES. Please assist. -----Original Message----- From: [hidden email] [mailto:[hidden email]] On Behalf Of [hidden email] Sent: 05 August 2008 07:33 PM To: [hidden email] Subject: Beginners Digest, Vol 28, Issue 6 Send Beginners mailing list submissions to [hidden email] To subscribe or unsubscribe via the World Wide Web, visit http://lists.squeakfoundation.org/mailman/listinfo/beginners or, via email, send a message with subject or body 'help' to [hidden email] You can reach the person managing the list at [hidden email] When replying, please edit your Subject line so it is more specific than "Re: Contents of Beginners digest..." Today's Topics: 1. true/false defined where? (Sean Allen) 2. Re: true/false defined where? (Derek O'Connell) 3. Re: true/false defined where? (Michael Rueger) 4. Re: true/false defined where? (Sean Allen) 5. Re: true/false defined where? (Randal L. Schwartz) 6. Re: true/false defined where? (Sean Allen) 7. Re: Problems getting started with OpenGL in Squeak (Ken G. Brown) 8. Fighting again with MC (Giuseppe Luigi Punzi) ---------------------------------------------------------------------- Message: 1 Date: Tue, 5 Aug 2008 08:48:24 -0400 From: Sean Allen <[hidden email]> Subject: [Newbies] true/false defined where? To: "A friendly place to get answers to even the most basic questions about Squeak." <[hidden email]> Message-ID: <[hidden email]> Content-Type: text/plain; charset=US-ASCII; format=flowed where do true and false spring into existence? i've been poking around and cant figure it out. ------------------------------ Message: 2 Date: Tue, 5 Aug 2008 13:53:18 +0100 From: "Derek O'Connell" <[hidden email]> Subject: Re: [Newbies] true/false defined where? To: "A friendly place to get answers to even the most basic questions about Squeak." <[hidden email]> Message-ID: <[hidden email]> Content-Type: text/plain; charset=ISO-8859-1 Have a look in Kernel-Objects On Tue, Aug 5, 2008 at 1:48 PM, Sean Allen <[hidden email]> wrote: > where do true and false spring into existence? > > i've been poking around and cant figure it out. > > _______________________________________________ > Beginners mailing list > [hidden email] > http://lists.squeakfoundation.org/mailman/listinfo/beginners > ------------------------------ Message: 3 Date: Tue, 05 Aug 2008 14:54:45 +0200 From: Michael Rueger <[hidden email]> Subject: Re: [Newbies] true/false defined where? To: "A friendly place to get answers to even the most basic questions about Squeak." <[hidden email]> Message-ID: <[hidden email]> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Sean Allen wrote: > where do true and false spring into existence? They have been around longer than some people on this mailing list ;-) > i've been poking around and cant figure it out. true and false and some of the very few objects known to the VM and they where instantiated when the parent of all current images was created. All images are basically cloned and not re-created from source, and that's why you don't see any initialization code for them, they just "are". Hope this doesn't add to any confusion... Michael ------------------------------ Message: 4 Date: Tue, 5 Aug 2008 09:09:01 -0400 From: Sean Allen <[hidden email]> Subject: Re: [Newbies] true/false defined where? To: "A friendly place to get answers to even the most basic questions about Squeak." <[hidden email]> Message-ID: <[hidden email]> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes On Aug 5, 2008, at 8:54 AM, Michael Rueger wrote: > Sean Allen wrote: >> where do true and false spring into existence? > > They have been around longer than some people on this mailing list ;-) > >> i've been poking around and cant figure it out. > > > true and false and some of the very few objects known to the VM and > they where instantiated when the parent of all current images was > created. > All images are basically cloned and not re-created from source, and > that's why you don't see any initialization code for them, they just > "are". > > Hope this doesn't add to any confusion... How is this for a confusing answer... it both does and doesnt. I have a feeling the secret to unraveling that confusion comes from this: 'true and false and some of the very few objects known to the VM' does that mean that I can't go and find these variables anywhere? that they arent true global variables they are some sort of special global? ------------------------------ Message: 5 Date: Tue, 05 Aug 2008 07:52:50 -0700 From: [hidden email] (Randal L. Schwartz) Subject: Re: [Newbies] true/false defined where? To: Sean Allen <[hidden email]> Cc: "A friendly place to get answers to even the most basic questions about Squeak." <[hidden email]> Message-ID: <[hidden email]> Content-Type: text/plain; charset=us-ascii >>>>> "Sean" == Sean Allen <[hidden email]> writes: Sean> I have a feeling the secret to unraveling that confusion comes from this: Sean> 'true and false and some of the very few objects known to the VM' Sean> does that mean that I can't go and find these variables anywhere? that Sean> they arent true global variables they are some sort of special global? If you explore "Smalltalk specialObjectsArray", you'll see a special list of variables that both the VM and the Smalltalk code have to agree on in order to run. For example, if a primitive wants to return "false", it has to know what the rest of the Smalltalk image considers the sole instance of the "False" class. These items are established in "SystemDictionary>>#recreateSpecialObjectsArray", the first version of which had to be executed essentially "by hand" on the first VM (either the early versions of Smalltalk 76 or 80). Since then, this special array has gotten its initial values by running it in an already running system, so the first few entries there (nil, false, true) are in fact clones of clones of clones of the original handcrafted objects. Of course, there's code on the VM side that knows the precise order of this magical array, and this is what allows them to communicate, so you can't just add new things here or change the ordering without building a corresponding new VM. -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 <[hidden email]> <URL:http://www.stonehenge.com/merlyn/> Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc. See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion ------------------------------ Message: 6 Date: Tue, 5 Aug 2008 11:20:46 -0400 From: Sean Allen <[hidden email]> Subject: Re: [Newbies] true/false defined where? To: Randal L. Schwartz <[hidden email]> Cc: "A friendly place to get answers to even the most basic questions about Squeak." <[hidden email]> Message-ID: <[hidden email]> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes On Aug 5, 2008, at 10:52 AM, Randal L. Schwartz wrote: >>>>>> "Sean" == Sean Allen <[hidden email]> writes: > > Sean> I have a feeling the secret to unraveling that confusion comes > from this: > > Sean> 'true and false and some of the very few objects known to the > VM' > > Sean> does that mean that I can't go and find these variables > anywhere? that > Sean> they arent true global variables they are some sort of special > global? > > If you explore "Smalltalk specialObjectsArray", you'll see a special > list of > variables that both the VM and the Smalltalk code have to agree on > in order to > run. For example, if a primitive wants to return "false", it has to > know what the rest of the Smalltalk image considers the sole instance > of the "False" class. > > These items are established in > "SystemDictionary>>#recreateSpecialObjectsArray", the first version > of which > had to be executed essentially "by hand" on the first VM (either the > early > versions of Smalltalk 76 or 80). Since then, this special array has > gotten > its initial values by running it in an already running system, so > the first > few entries there (nil, false, true) are in fact clones of clones of > clones of > the original handcrafted objects. Of course, there's code on the VM > side that > knows the precise order of this magical array, and this is what > allows them to > communicate, so you can't just add new things here or change the > ordering > without building a corresponding new VM. Thanks for the pointer of where to explore and the background info. In a couple days when I've had time to review and digest hopefully it will all make sense. ------------------------------ Message: 7 Date: Tue, 5 Aug 2008 10:39:19 -0600 From: "Ken G. Brown" <[hidden email]> Subject: Re: [Newbies] Problems getting started with OpenGL in Squeak To: [hidden email] Message-ID: <p06240402c4be2f7ab3a6@[10.0.1.200]> Content-Type: text/plain; charset="us-ascii" At 5:00 AM -0700 8/5/08, [hidden email] apparently wrote: >Date: Mon, 4 Aug 2008 14:48:26 -0700 (PDT) >From: Nick Ager <[hidden email]> >Subject: Re: [Newbies] Problems getting started with OpenGL in Squeak >To: [hidden email] >Message-ID: <[hidden email]> >Content-Type: text/plain; charset=us-ascii > > > >> Not sure this will help in your case, but just for information, there are >some plugin naming convention i>> ssues, the generated name does not always >match the plugin name. > >>> internal plugin B3DEnginePlugin generated as Squeak3D > >the list produced by executing: "SmalltalkImage current listBuiltinModules" >includes B3DAcceleratorPlugin. Could that be a synonym for "Squeak3D"? Where >is the mapping between the names? > >Looking again at the Croquet image, when showing a 3D window, >"SmalltalkImage current listLoadedModules" includes B3DAcceleratorPlugin and >opengl32.dll > >Although I'm not sure this gets me closer to solving my problem... >-- >View this message in context: http://www.nabble.com/Problems-getting-started-with-OpenGL-in-Squeak-tp18752 922p18820572.html >Sent from the Squeak - Beginners mailing list archive at Nabble.com. If you load VMMaker and look in the 'VMMaker' category (package?), you will see InterpreterPlugin class. The plugins are subclasses of this or SmartSyntaxInterpreterPlugin. The #InterpreterPlugin class has the moduleName instance variable. Some of the plugins have class methods that return their name eg. B3DAcceleratorPlugin has moduleName ^'B3DAcceleratorPlugin' Not exactly sure where the moduleName gets set in other plugins. Maybe someone else can tell how this works in more detail. Ken G. Brown ------------------------------ Message: 8 Date: Tue, 05 Aug 2008 19:23:16 +0200 From: Giuseppe Luigi Punzi <[hidden email]> Subject: [Newbies] Fighting again with MC To: "A friendly place to get answers to even the most basic questions about Squeak." <[hidden email]> Message-ID: <[hidden email]> Content-Type: text/plain; charset="iso-8859-1" Hi all, Is the second time I'm having troubles with simple changes to my package :S, and I can't figure out what I'm doing bad. I'm working in a little app. I did it 2 minor changes writing some comments on Doc side of a class, one line on a method commented and so on. Now, I'm trying to commit to my MC repository, and I get an: Error: Subscript Out Of Bounds: 1 Following the debugger, seems the error is in: foreignExtensionMethodsForClass: aClass ^ (self foreignExtensionCategoriesForClass: aClass) gather: [:cat | (aClass organization listAtCategoryNamed: cat) collect: [:sel | self referenceForMethod: sel ofClass: aClass]] where 'cat' is nil. But I don't know wich Category is this. Some advice? Note: Debug Report attached. <cid:[hidden email]> -------------- next part -------------- Error: subscript is out of bounds: 1 5 August 2008 7:07:25 pm VM: Win32 - a SmalltalkImage Image: Squeak3.10.2 [latest update: #7179] SecurityManager state: Restricted: false FileAccess: true SocketAccess: true Working Dir E:\Desarrollo\Squeak3.10.2-7179-glp Trusted Dir E:\Desarrollo\Squeak3.10.2-7179-glp\Giuseppe Untrusted Dir C:\My Squeak\Giuseppe ByteSymbol(Object)>>error: Receiver: #'' Arguments and temporary variables: aString: 'subscript is out of bounds: 1' Receiver's instance variables: #'' ByteSymbol(Object)>>errorSubscriptBounds: Receiver: #'' Arguments and temporary variables: index: 1 Receiver's instance variables: #'' ByteSymbol(Object)>>at: Receiver: #'' Arguments and temporary variables: index: 1 Receiver's instance variables: #'' ByteSymbol>>at: Receiver: #'' Arguments and temporary variables: index: 1 Receiver's instance variables: #'' --- The full stack --- ByteSymbol(Object)>>error: ByteSymbol(Object)>>errorSubscriptBounds: ByteSymbol(Object)>>at: ByteSymbol>>at: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ByteSymbol(SequenceableCollection)>>first PackageInfo>>isForeignClassExtension: [] in PackageInfo>>foreignExtensionCategoriesForClass: {[:cat | self isForeignClassExtension: cat]} Array(SequenceableCollection)>>select: PackageInfo>>foreignExtensionCategoriesForClass: PackageInfo>>foreignExtensionMethodsForClass: PackageInfo>>coreMethodsForClass: [] in PackageInfo>>coreMethods {[:class | self coreMethodsForClass: class]} [] in OrderedCollection(Collection)>>gather: {[:ea | stream nextPutAll: (aBlock value: ea)]} OrderedCollection>>do: [] in OrderedCollection(Collection)>>gather: {[:stream | self do: [:ea | stream nextPutAll: (aBlock value: ea)]]} Array class(SequenceableCollection class)>>streamContents: OrderedCollection(Collection)>>gather: PackageInfo>>coreMethods PackageInfo>>methods MCPackage>>snapshot MCWorkingCopy>>newVersionWithName:message: [] in MCWorkingCopy>>newVersion {[:pair | self newVersionWithName: pair first message: pair last]} Array(Object)>>ifNotNilDo: MCWorkingCopy>>newVersion MCWorkingCopyBrowser>>saveVersion PluggableButtonMorphPlus(PluggableButtonMorph)>>performAction PluggableButtonMorphPlus>>performAction [] in PluggableButtonMorphPlus(PluggableButtonMorph)>>mouseUp: {[:m | (m containsPoint: evt cursorPoint) ifTrue: [m performAction]]} Array(SequenceableCollection)>>do: PluggableButtonMorphPlus(PluggableButtonMorph)>>mouseUp: PluggableButtonMorphPlus>>mouseUp: PluggableButtonMorphPlus(Morph)>>handleMouseUp: MouseButtonEvent>>sentTo: PluggableButtonMorphPlus(Morph)>>handleEvent: PluggableButtonMorphPlus(Morph)>>handleFocusEvent: [] in HandMorph>>sendFocusEvent:to:clear: {[ActiveHand := self. ActiveEvent := anEvent. e := anEvent transformedB...]} [] in PasteUpMorph>>becomeActiveDuring: {[aBlock value]} BlockContext>>on:do: PasteUpMorph>>becomeActiveDuring: HandMorph>>sendFocusEvent:to:clear: HandMorph>>sendEvent:focus:clear: HandMorph>>sendMouseEvent: HandMorph>>handleEvent: HandMorph>>processEvents [] in WorldState>>doOneCycleNowFor: {[:h | ActiveHand := h. h processEvents. capturingGesture := capturingGest...]} Array(SequenceableCollection)>>do: WorldState>>handsDo: WorldState>>doOneCycleNowFor: WorldState>>doOneCycleFor: PasteUpMorph>>doOneCycle [] in Project class>>spawnNewProcess {[[World doOneCycle. Processor yield. false] whileFalse. nil]} [] in BlockContext>>newProcess {[self value. Processor terminateActive]} ------------------------------ _______________________________________________ Beginners mailing list [hidden email] http://lists.squeakfoundation.org/mailman/listinfo/beginners End of Beginners Digest, Vol 28, Issue 6 **************************************** _______________________________________________ Beginners mailing list [hidden email] http://lists.squeakfoundation.org/mailman/listinfo/beginners |
On Wed, 06 Aug 2008 13:47:39 +0200, Riaan van Aarde wrote:
> I have the following code > > renderAttendeesOn: html > self workSession attendees do: [:each | html text: each person > displayString] > separatedBy: [html text:'; '.] > > if there is no attendees for my worksession, it needs to display : NO > ABSENTEES. You can assign subexpression (self workSession attendees) to a temporary variable wsa and after the statement (wsa #do: ...) have another statement like this wsa ifEmpty ifTrue: ["what you would like to do if there is no attendees"]. HTH. /Klaus > Please assist. > > -----Original Message----- > From: [hidden email] > [mailto:[hidden email]] On Behalf Of > [hidden email] > Sent: 05 August 2008 07:33 PM > To: [hidden email] > Subject: Beginners Digest, Vol 28, Issue 6 > > Send Beginners mailing list submissions to > [hidden email] > > To subscribe or unsubscribe via the World Wide Web, visit > http://lists.squeakfoundation.org/mailman/listinfo/beginners > or, via email, send a message with subject or body 'help' to > [hidden email] > > You can reach the person managing the list at > [hidden email] > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Beginners digest..." > > > Today's Topics: > > 1. true/false defined where? (Sean Allen) > 2. Re: true/false defined where? (Derek O'Connell) > 3. Re: true/false defined where? (Michael Rueger) > 4. Re: true/false defined where? (Sean Allen) > 5. Re: true/false defined where? (Randal L. Schwartz) > 6. Re: true/false defined where? (Sean Allen) > 7. Re: Problems getting started with OpenGL in Squeak (Ken G. Brown) > 8. Fighting again with MC (Giuseppe Luigi Punzi) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Tue, 5 Aug 2008 08:48:24 -0400 > From: Sean Allen <[hidden email]> > Subject: [Newbies] true/false defined where? > To: "A friendly place to get answers to even the most basic questions > about Squeak." <[hidden email]> > Message-ID: > <[hidden email]> > Content-Type: text/plain; charset=US-ASCII; format=flowed > > where do true and false spring into existence? > > i've been poking around and cant figure it out. > > > > ------------------------------ > > Message: 2 > Date: Tue, 5 Aug 2008 13:53:18 +0100 > From: "Derek O'Connell" <[hidden email]> > Subject: Re: [Newbies] true/false defined where? > To: "A friendly place to get answers to even the most basic questions > about Squeak." <[hidden email]> > Message-ID: > <[hidden email]> > Content-Type: text/plain; charset=ISO-8859-1 > > Have a look in Kernel-Objects > > On Tue, Aug 5, 2008 at 1:48 PM, Sean Allen <[hidden email]> > wrote: >> where do true and false spring into existence? >> >> i've been poking around and cant figure it out. >> >> _______________________________________________ >> Beginners mailing list >> [hidden email] >> http://lists.squeakfoundation.org/mailman/listinfo/beginners >> > > > ------------------------------ > > Message: 3 > Date: Tue, 05 Aug 2008 14:54:45 +0200 > From: Michael Rueger <[hidden email]> > Subject: Re: [Newbies] true/false defined where? > To: "A friendly place to get answers to even the most basic questions > about Squeak." <[hidden email]> > Message-ID: <[hidden email]> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Sean Allen wrote: >> where do true and false spring into existence? > > They have been around longer than some people on this mailing list ;-) > >> i've been poking around and cant figure it out. > > > true and false and some of the very few objects known to the VM and they > where instantiated when the parent of all current images was created. > All images are basically cloned and not re-created from source, and > that's why you don't see any initialization code for them, they just > "are". > > Hope this doesn't add to any confusion... > > Michael > > > ------------------------------ > > Message: 4 > Date: Tue, 5 Aug 2008 09:09:01 -0400 > From: Sean Allen <[hidden email]> > Subject: Re: [Newbies] true/false defined where? > To: "A friendly place to get answers to even the most basic questions > about Squeak." <[hidden email]> > Message-ID: > <[hidden email]> > Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes > > > On Aug 5, 2008, at 8:54 AM, Michael Rueger wrote: > >> Sean Allen wrote: >>> where do true and false spring into existence? >> >> They have been around longer than some people on this mailing list ;-) >> >>> i've been poking around and cant figure it out. >> >> >> true and false and some of the very few objects known to the VM and >> they where instantiated when the parent of all current images was >> created. >> All images are basically cloned and not re-created from source, and >> that's why you don't see any initialization code for them, they just >> "are". >> >> Hope this doesn't add to any confusion... > > How is this for a confusing answer... it both does and doesnt. > > I have a feeling the secret to unraveling that confusion comes from > this: > > 'true and false and some of the very few objects known to the VM' > > does that mean that I can't go and find these variables anywhere? that > they arent true > global variables they are some sort of special global? > > > > ------------------------------ > > Message: 5 > Date: Tue, 05 Aug 2008 07:52:50 -0700 > From: [hidden email] (Randal L. Schwartz) > Subject: Re: [Newbies] true/false defined where? > To: Sean Allen <[hidden email]> > Cc: "A friendly place to get answers to even the most basic questions > about Squeak." <[hidden email]> > Message-ID: <[hidden email]> > Content-Type: text/plain; charset=us-ascii > >>>>>> "Sean" == Sean Allen <[hidden email]> writes: > > Sean> I have a feeling the secret to unraveling that confusion comes from > this: > > Sean> 'true and false and some of the very few objects known to the VM' > > Sean> does that mean that I can't go and find these variables anywhere? > that > Sean> they arent true global variables they are some sort of special > global? > > If you explore "Smalltalk specialObjectsArray", you'll see a special > list of > variables that both the VM and the Smalltalk code have to agree on in > order > to > run. For example, if a primitive wants to return "false", it has to > know what the rest of the Smalltalk image considers the sole instance > of the "False" class. > > These items are established in > "SystemDictionary>>#recreateSpecialObjectsArray", the first version of > which > had to be executed essentially "by hand" on the first VM (either the > early > versions of Smalltalk 76 or 80). Since then, this special array has > gotten > its initial values by running it in an already running system, so the > first > few entries there (nil, false, true) are in fact clones of clones of > clones > of > the original handcrafted objects. Of course, there's code on the VM side > that > knows the precise order of this magical array, and this is what allows > them > to > communicate, so you can't just add new things here or change the ordering > without building a corresponding new VM. > _______________________________________________ Beginners mailing list [hidden email] http://lists.squeakfoundation.org/mailman/listinfo/beginners |
In reply to this post by Riaan van Aarde (SpeCon Eng.)
I would probably do as Klaus suggests but you could also use a cascade
and then #ifEmpty:. For example: self workSession attendees do: [:each | html text: each person displayString] separatedBy: [html text: '; '] ; ifEmpty: [html text: 'NO ATTENDEES'] Note the cascade ";" at the end of the third line. This sends #do:seperatedBy: and then sends #ifEmpty: to the collection returned by #attendees. Of course, #ifEmpty: and #do:separatedBy: will only do something if the collection is either empty or not. Regards, Zulq. Riaan van Aarde (SpeCon Eng.) wrote: > I have the following code > > renderAttendeesOn: html > self workSession attendees do: [:each | html text: each person > displayString] > separatedBy: [html text:'; '.] > > if there is no attendees for my worksession, it needs to display : NO > ABSENTEES. > > Please assist. > _______________________________________________ Beginners mailing list [hidden email] http://lists.squeakfoundation.org/mailman/listinfo/beginners |
Free forum by Nabble | Edit this page |