I feel I must respond to this posting. The three questions posed by Saurabh appeared as the first three questions on an exam I gave to a class recently. For clarification of what he is asking about, I have included the original text of the exam questions here. The exams have already been submitted and graded so there is no prohibition to anyone who wishes to respond to these questions to do so.
Sincerely, Michael Meehan 1. Suppose that we wished to add a new native type to the Unicon virtual machine called a black box type. The purpose of the black box is to create objects of a fixed size that can only be used in assignment operations and tests for equality. For example, suppose we had a language construct such as x:=black_box(40); This would create a 40 byte long black_box in the variable x. This would be implemented in the virtual machine as a new descriptor type The purpose of the black box is to provide a way to store data from a "foreign context" such as a structure returned form a call to a C function via loadfunc. Having a black box type that the virtual machine knows can only be passed as a parameter, assigned to a variable and compared for equality ensures that nothing in the "Unicon environment" can be done to modify the contents of the black box. It simply provides a box in which to "carry around" the data that is given meaning outside the "Unicon environment." a) Show how the black box type would be implemented in the Unicon language and the virtual machine. Indicate ALL places in the virtual machine that would be impacted by the addition of the black box type. b) Juxtapose implementing a black box type as an intrinsic abstract machine type versus creating it via the Unicon class facilities. 2. Describe how the concept of exceptions and exception handlers could be implemented in the Unicon language. Explain how they would relate to the concept expression of success and failure. Give source language syntax extensions that you would suggest for creating this capability in the language. Point out any orthogonality issues that arise from the way you chose to add this feature to the existing language. Explain modifications to virtual machine that would be required to support your exception handling language features. 3. Suppose we wished to add support for character sets other than ASCII to Unicon. For example, suppose we wished to be able to support all the common character formats the appear in MIME encodings such as UTF-8, Unicode etc. How would you modify Unicon to be able to handle these additional characters sets. Note that Unicon is a language that was designed to excel in the manipulation of character data. Thus, you would want to ensure that the ability to deal with other character sets could take advantage of all the Unicon string search and manipulation capabilities is a "seamless" fashion. Describe how you would modify the source language features to support extended characters sets. Describe any changes required to the underlying virtual machine that would be required to implement your solution. -----Original Message----- From: Saurabh Chandhok [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 12:07 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: [Unicon-group] Help Hi, I have 3 questions regarding the Unicon language. It would be great if you could help me out here... 1) if i neeed to implement another type in Unicon, could u Juxtapose implementing it as an intrinsic abstract machine type versus creating it via the Unicon class facilties. Can u please tell me what advantages/disadvantages would it be to implement it as intrinsic abstract machine Vs. creating it via Unicon class? 2) Another thing i want to ask is if we would be able to support all common character format such as UTF-8,Unicode etc. other than ASCII, how would you modify Unicon to be to handle these additional character sets? Can you please tell me how would you modify the source language features to support extended character set and what changes would be reqired to the underlying virtual machine? just a brief information. It would be very kind and helpful of you if you could give me some brief information regarding these questions...Another thing i would like to know is 3) If you would like to implement the concept of Exceptions and exception handlers how would u do that? how would they related to the concept expression of sucess and failure? Can u please give me suggest me source language syntax extensions for creating this capability? What modifications would be required to virtual machine to support this? I would be grateful if you could give me some information and answers to these questions. Thank you Saurabh __________________________________ Do you Yahoo!? Yahoo! Calendar - Free online calendar with sync to Outlook(TM). http://calendar.yahoo.com ------------------------------------------------------- This SF.NET email is sponsored by: eBay Great deals on office technology -- on eBay now! Click here: http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5 _______________________________________________ Unicon-group mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/unicon-group ------------------------------------------------------- This SF.NET email is sponsored by: eBay Great deals on office technology -- on eBay now! Click here: http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5 _______________________________________________ Unicon-group mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/unicon-group
