Park SungMin | 18 May 2013 15:03
Favicon

Live Coding On ClozureCL.


Live Coding demo on ClozureCL.I used my supercollider client(sound) and ObjC bridge/cl-opengl(graphics).

I have used ClozureCL for about 8 years. It's best tool for me.
Thanks for dev.

https://vimeo.com/66448855
_______________________________________________
Openmcl-devel mailing list
Openmcl-devel <at> clozure.com
http://clozure.com/mailman/listinfo/openmcl-devel
Ron Garret | 17 May 2013 22:05
Favicon

Is this a known problem?

I'm way behind the times, running version 1.8-store-r15418.  If I start the IDE and the first thing I do is
open a file and evaluate it with cmd-shift-E then my ccl-init file does not get loaded.  If I select the
evaluate-all menu item with the mouse then ccl-init gets loaded normally.

Is this a known problem?  Has it been fixed in more recent versions?  I'm running Snow Leopard and using CCL for
something mission-critical, so I'm a little gun-shy of upgrading at this point.

Thanks,
rg
Paul Krueger | 16 May 2013 16:52
Picon

Download my contrib for CCL 1.9

I had one request for access to my new contrib (presumably for people running CCL 1.9 who don't want to track the trunk), so I zipped it and have made it available for download from  http://bigw.org/~pkrueger/misc/InterfaceProjects.zip.

This server is not especially fast, so be patient.

You can just replace …ccl/contrib/cocoa-ide/krueger/InterfaceProjects with the unzipped folder. There are a bunch of temporary test files and a few work-in-progress things that are there which were not part of the checked in code, but you can just ignore those.

Paul
_______________________________________________
Openmcl-devel mailing list
Openmcl-devel <at> clozure.com
http://clozure.com/mailman/listinfo/openmcl-devel
Paul Krueger | 14 May 2013 21:33
Picon

Updated Contrib

All,

I finally checked in a completely new revision of my contrib: .../ccl/cocoa-ide/krueger/InterfaceProjects/...

All code requires OSX 10.7 or higher and CCL 1.9 or higher.

Synopsis of features:
  • Documentation
    • UserInterfaceTutorial.pdf is an extensive description of how to construct Cocoa user interfaces without having to resort to Xcode or InterfaceBuilder. It makes heavy use of Cocoa's layout constraint functionality.
    • CCL Cocoa Developer Tools Tutorial.pdf explains how to install and use application build/test code within the CCL IDE to construct apps that you can also run within the IDE for testing before creating stand-alone applications.
    • Lisp-KVO Reference & Tutorial.pdf explains functionality that lets you make slots in standard Lisp classes be KVO compliant and supports binding between Objective-C view properties and those slots. 
    • LispController Reference.pdf describes how to use the lisp-controller class as a lisp-friendly controller to manage view objects like NSTableView NSOutlineView.
  • Code Highlights
    • Major Functionality
      • Support for running Lisp apps under the CCL IDE, including swapping of the main menu
      • Tools for creating stand-along Lisp apps
      • Support for binding between Objective-C objects and Lisp slots
      • Extensive Lisp/Objective-C data conversion support via a coerce-obj method
      • Conversion of standard-instance objects to a format that can be archived to disk and restored correctly.
      • Initialize-instance :after methods for 20 common Objective-C classes that let you call make-instance for them using typical lisp keyword initialization syntax with all necessary data conversion done automatically for you. As a design principle, no default behavior is modified by these methods unless explicitly requested via a keyword argument. These are self-documenting via a window that can be invoked from the CCL Tools menu which shows and lets you search class hierarchies and see permitted initialization keywords, acceptable keyword values, and allowed binding targets.
      • Lisp interface for Apple's layout constraint functionality including the addition of several common layout idioms to make window design easier. See Appendix B in UserInterfaceTutorial.pdf for a complete description.
    • Special purpose utility classes and functionality
      • An N-dimensional sparse associative array
      • A Lisp attributed string stream class
      • Date manipulation and formatting utilities
      • Bundle interface code
      • NIB interface code
      • Lisp interface to Cocoa "undo" functionality
      • Lisp-document class which provides support for saving, loading, undo'ing, and printing documents defined with lisp data slots
      • Lisp-window-controller class which supports window "loading" using a lisp function rather than loading from a NIB file
      • Lisp interface to the Cocoa notification functionality.
      • A thread-safe queue implementation
    • Custom view classes and view-supporting classes
      • combo-box source class
      • Support for acting as a data source for NSTableView and NSOutlineView objects
      • Menu and menuitem creation functions for both common and custom items
      • Lisp interface to NSOpenPanel and NSSavePanel
      • Lisp button class that lets buttons call lisp methods
      • An organized-box-view that arranges subviews as directed
      • A resizable-box-view that dynamically rearranges its content views into a reasonable array as the box size changes
      • A radio-button box view which calls lisp methods when buttons are selected
      • A scrolled text view
      • A scrolled text view which can act as a Lisp output stream
      • Label view
      • Labeled text field
      • A form-view which is an aligned set of text fields with labels

If you run into any problems, please contact me directly and I'll try to address them. Any suggestions or other comments are welcomed.

Paul

_______________________________________________
Openmcl-devel mailing list
Openmcl-devel <at> clozure.com
http://clozure.com/mailman/listinfo/openmcl-devel
Taoufik Dachraoui | 14 May 2013 12:37
Picon

consing

Hi

This is probably simple but I could not figure out the explanation, I hope that
someone could help me out

CL-USER> (defun fac (n) (if (= n 0) 1 (* n (fac (- n 1)))))
FAC
CL-USER> (time (fac 3))
(FAC 3)
took 0 milliseconds (0.000 seconds) to run.
During that period, and with 1 available CPU core,
     0 milliseconds (0.000 seconds) were spent in user mode
     0 milliseconds (0.000 seconds) were spent in system mode
6

As you can see, there is no consing when FAC is called

Now, knowing that pushing an element on the stack, (PUSH 1 X) is equivalent
to (SETQ X (CONS 1 X)), and since FAC is using a stack and thus pushing 
values on the stack why there is no consing when (FAC 3) is called?

I believe there is a simple explanation but I could not figure it out

Kind regards
Taoufik

_______________________________________________
Openmcl-devel mailing list
Openmcl-devel <at> clozure.com
http://clozure.com/mailman/listinfo/openmcl-devel
Michael Minerva | 11 May 2013 00:09

(no subject)

Hey Matthew,

We are trying to submit a CCL app to the app store and I was wondering if you could tell me how you guys were able to actually submit.

Did you Application Loader? 

I found this post on Stackoverflow:


but this is about how to submit an IOS app (not on OSX app), and all of Apple's documentation assume you are using XCode. The article I linked suggests creating an .ipa file but that seems to be only for IOS devices. When I run Application Loader I am unable to select my .app file (it is greyed out) and I was wondering if you knew if we needed to create some kind of zip file similar to a .ipa file.

Thanks a lot,

--Mike
Attachment (smime.p7s): application/pkcs7-signature, 2559 bytes
_______________________________________________
Openmcl-devel mailing list
Openmcl-devel <at> clozure.com
http://clozure.com/mailman/listinfo/openmcl-devel
Mark Klein | 3 May 2013 16:20
Picon
Favicon

simple graphics package for clozure?


Is there something simpler to understand and use than the COCOA bridge, if all I want to do is draw some simple
2d graphs in a window? I  was happy with the G package for Mac Common Lisp, so something like that would be great.

Thanks for any suggestions.

	Mark

-------------------------------
Mark Klein
Principal Research Scientist
MIT Center for Collective Intelligence
http://cci.mit.edu/klein/

Attachment (smime.p7s): application/pkcs7-signature, 1581 bytes
_______________________________________________
Openmcl-devel mailing list
Openmcl-devel <at> clozure.com
http://clozure.com/mailman/listinfo/openmcl-devel
Kelly McDonald | 4 May 2013 03:12
Favicon
Gravatar

CCL on BeagleBone (Angstrom)

Hello,

If I can put in a ticket, please let me know, otherwise please see the following patch	

I got a new beaglebone black today - and of course I was disappointed when CCL wouldn't work - I got an error
message :

CPU doesn't support required features

After digging a little I found that the /proc/cpuinfo was different than what was expected:

root <at> beaglebone:~/ccl/lisp-kernel# cat /proc/cpuinfo
processor	: 0
model name	: ARMv7 Processor rev 2 (v7l)
BogoMIPS	: 297.40
Features	: swp half thumb fastmult vfp edsp thumbee neon vfpv3 tls 
CPU implementer	: 0x41
CPU architecture: 7
CPU variant	: 0x3
CPU part	: 0xc08
CPU revision	: 2

Hardware	: Generic AM33XX (Flattened Device Tree)
Revision	: 0000
Serial		: 0000000000000000

So, I patched the source with the following:

--- pmcl-kernel.c	(revision 15801)
+++ pmcl-kernel.c	(working copy)
 <at>  <at>  -1604,7 +1604,7  <at>  <at> 
         break;
       }
       n = strlen(line);
-      if (strncmp(line,"Processor",sizeof("Processor")-1) == 0) {
+      if ((strncmp(line,"Processor",sizeof("Processor")-1) == 0) || (strncmp(line,"model
name",sizeof("model name")-1)) == 0) {
         procline = malloc(n+1);
         strcpy(procline,line);

- it looks as if this took care of the problem -

Thanks!

Kelly
Michael Minerva | 2 May 2013 23:32

CCL Issue with Lion

We are experiencing another strange issue, this time it is related to Lion and Sandboxing.  We initially noticed the issue when we tried to test a sandboxed version of our app on Lion. Every time we would try and launch an NSOpenPanel, it would stall for about 10 seconds, nothing would come up and then the program would resume. The call to runModal returns without ever bringing up the window and there is no error in the console. In order to try and dissect this problem a little further, we downloaded a fresh copy of the release version of CCL and sandboxed both the 32bit and 64bit versions of CCL, when we fired up these apps on Lion and simply tried to open a file (command O or open… from the File menu) the same behavior we saw in our app occurs in the sandboxed CCL I.E. the File menu is highlighted and stalled for 10 seconds, no file chooser comes up and then it returns without ever showing the chooser.  We have also tried this same experiment with the most recent trunk of CCL and it exhibits the same behavior. 

A few Notes:
• This occurs only on Mountain Lion we have tested versions 10.7.2  and 10.7.5 and it occurs on both
• We have tested on Mountain Lion and Snow Leopard and this problem does not occur (even with the sandboxed versions)
• We have tried sandboxing with a valid certificate like this: codesign -s "Developer ID Application: AgentSheets, Inc."   -f --entitlements /Users/Mike/Desktop/AgentCubes\ 1.02-Lite/AgentCubes32bit.app/Contents/AgentCubes.entitlements /Users/Mike/ccldev15801/Clozure\ CL32.app 
• We have also tried sandboxing with no certificate like:  codesign -s  - -f --entitlements /Users/Mike/Desktop/AgentCubes\ 1.02-Lite/AgentCubes32bit.app/Contents/AgentCubes.entitlements /Users/Mike/ccldev15801/Clozure\ CL64.app 
• Both the code signed and non code signed sandboxed apps exhibit the issue
• We have examined the code signed app with spctl to verify that it is code signed with a valid certificate 

Here is a link to a sandboxed version of CCL 1.9 release:


When we open this version in Lion and goto File-> Open it exhibits the issue (no file chooser comes up and the File menu stalls blue for ~10 seconds).  Could anyone else running Lion verify that they see the same issue?  Anyone have any clues about what could be going on here?  

--Mike
Attachment (smime.p7s): application/pkcs7-signature, 2559 bytes
_______________________________________________
Openmcl-devel mailing list
Openmcl-devel <at> clozure.com
http://clozure.com/mailman/listinfo/openmcl-devel
Ron Garret | 26 Apr 2013 02:44
Favicon

Alternative parens

Looking at the code in

cocoa-ide/hemlock/src/defsyn.lisp

it would appear that if one did, e.g.:

(setf (hi::character-attribute :lisp-syntax #\[) :open-paren)
(setf (hi::character-attribute :lisp-syntax #\]) :close-paren)

that the editor should then treat square-bracketed expressions the same as paren-bracketed ones.  But it
doesn't seem to work.  What is the right way to get Hemlock to recognize other kinds of balanced delimiters?

Thanks,
rg
Alexander Repenning | 26 Apr 2013 02:30
Picon
Favicon

CCL apps likely to crash on OS X Mountain Lion when including NSScrollView

We have a very strange thing going on with NSScrollView on Mountain Lion. It is not clear if CCL is directly or
indirectly causing this but the bottom line is that any CCL/Cocoa based application including 
NSScrollViews (they are pretty handy) trying to run on Mountain Lion has a good chance of crashing. Took us
a while to narrow some mysterious crashes down to this. To make things worse, this only seems to happen on
about 50% of the machines we tested on. 

This is what happens. If you have a Mountain Lion machine with the following system preference: "Show
scroll bars" to "Automatically based on mouse or trackpad" In this mode, any NSScrollView will only show
scroll handles when the mouse is hovering over it. This behavior seems to be achieved, not surprisingly,
through a timer. On SOME machines the moment you create an NSScrollView and set it frame this timer gets
started and if about ~1 second later, if that NSScrollView is not ready for some update all hell breaks
loose. On the trace below you can see:

 a call to [_NSScrollerStyleRecommender scrollerStyleRecommendationUpdateTimerFired:] resulting
in a call to [NSScrollerImpPair _updateAllScrollerImpPairsForNewRecommendedScrollerStyle:] 

Of course these methods are not documented. A search and query on Stack overflow did not result in anything.
Regular Xcode apps with NSScrollViews do not appear to exhibit this problem.

To reproduce you can run the code below. A window with a button will show up. Press the button. With 50% chance
the crash will happen. Observations:

- no correlation to version of CCL (1.9, 32bit/64bit)
- no correlation to version of Mountain Lion 10.8.1, 10.8.2, 10.8.3. have all been observed to crash
- the crash either happens EVERY TIME you press the button or NEVER
- the crash never happens in CCL with a Listener present

The test code below just makes an instance of NSScrollView and calls initWithFrame. No view actually shows
up. This is not super meaningful but has a high chance of causing the problem.  

Any idea what could cause this or better how how to stop this would be super helpful. Test source, link to test
app and stack trace are below. The main question is why, on some machines, this timer would be started and
how this could be correlated in CCL to have listener window, or not. Any ideas would be appreciated. 

best,  Alex

__________ Scroll-crash.lisp ___________

;; eval file in CCL  and then launch the app created

(in-package :gui)

(defun SHOW-TEST-WINDOW ()
  (let ((window (make-instance ns:ns-window          
                  :with-content-rect (ns:make-ns-rect 100 800 300 50)
                  :style-mask
                  (logior #$NSTitledWindowMask
                          #$NSClosableWindowMask
                          #$NSResizableWindowMask
                          #$NSMiniaturizableWindowMask)
                  :backing #$NSBackingStoreBuffered
                  :defer t))
        (content-view (#/initWithFrame: (#/alloc ns:ns-view) (ns:make-ns-rect 0 0 300 50)))
        (button (#/initWithFrame: (#/alloc ns:ns-button) (ns:make-ns-rect 0 0 300 50))))
    (#/setAction: button (objc:: <at> selector #/nsButtonAction))
    (#/setTitle: button (ccl::%make-nsstring "Make NSScrollView"))
    (#/setContentView: window content-view)
    (#/addSubview: content-view button)
    (#/orderFront: window nil)))

(objc:defmethod (#/nsButtonAction :void) ((self ns:ns-button))
  (let ((scroll-view (make-instance 'ns:ns-scroll-view)))
    (ns:with-ns-rect (Frame 0 0 100 100)
      (#/initWithFrame: scroll-view Frame))))

(objc:defmethod (#/applicationDidFinishLaunching: :void)
                ((self lisp-application-delegate) notification)
  (declare (ignore notification))
  (show-test-window))

(objc:defmethod (#/applicationShouldOpenUntitledFile: #>BOOL)
                ((self lisp-application-delegate) app)
  ;; DO NOT SHOW LISTENR!
  (declare (ignore app))
  nil)

(progn 
  (require "build-application")
  (ccl::build-application :name "Scroll-CRASH"
			  :directory (format nil "~A/Desktop/" (user-homedir-pathname))))

_________ end ______________

For your replication convenience here is a ready to launch test app in CCL (~80MB): http://www.cs.colorado.edu/~ralex/temp/Scroll-CRASH.app

more info:

• The bug was initially showing up in AgentCubes and would cause a crash every time we brought up a window
that contains an NSScrollView
• We tested it on 4 different mountain lion machines and the bug would occur on all of them when the 
"Automatically based on mouse or trackpad" preference was set
• We have tried to reproduce the bug with just CCL but it never seems to occur inside of the CCL application
• We have found that we need to create an application which has no listener in order to reproduce the error
(this is done in the test app)
• We eventually narrowed the bug down to a call to initWithFrame: if this is called on an NSScrollView,
inside of an application which has no listener then the crash will happen if the preference is set
• We tried to run many other tests but most of them were related to our cocoa wrapper which turned out to be a
dead end when we discovered the bug could be reproduce with only the cocoa class

Here is the stack trace:

4/24/13 3:10:57.761 PM Scroll-CRASH[1010]: *** Terminating app due to uncaught exception
'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: scrollerImpPair
== SCROLLER_IMP_PAIR'
*** Call stack at first throw:
(
	0   CoreFoundation                      0x99cbee9b __raiseError + 219
	1   libobjc.A.dylib                     0x90a6552e objc_exception_throw + 230
	2   CoreFoundation                      0x99c1e6a8 +[NSException raise:format:arguments:] + 136
	3   Foundation                          0x93dfb814 -[NSAssertionHandler
handleFailureInMethod:object:file:lineNumber:description:] + 116
	4   AppKit                              0x977cd7ab -[NSScrollView(NSPrivate)
scrollerImpPair:updateScrollerStyleForNewRecommendedScrollerStyle:] + 150
	5   AppKit                              0x977cd6a5 +[NSScrollerImpPair
_updateAllScrollerImpPairsForNewRecommendedScrollerStyle:] + 406
	6   AppKit                              0x977cd4ff +[NSScrollerImpPair _scrollerStyleRecommendationChanged:] + 159
	7   Foundation                          0x93e52152 __57-[NSNotificationCenter
addObserver:selector:name:object:]_block_invoke_0 + 49
	8   CoreFoundation                      0x99c80861 ___CFXNotificationPost_block_invoke_0 + 257
	9   CoreFoundation                      0x99bcbe9a _CFXNotificationPost + 2794
	10  Foundation                          0x93e3ac88 -[NSNotificationCenter postNotificationName:object:userInfo:] + 92
	11  AppKit                              0x977cd3f5 -[_NSScrollerStyleRecommender setRecommendedScrollerStyleAndNotify:] + 248
	12  AppKit                              0x977cd2e3 __75-[_NSScrollerStyleRecommender
scrollerStyleRecommendationUpdateTimerFired:]_block_invoke_0 + 43
	13  AppKit                              0x97eff42f __block_global_0 + 32
	14  libdispatch.dylib                   0x98f10f8f _dispatch_call_block_and_release + 15
	15  libdispatch.dylib                   0x98f0cc82 _dispatch_client_callout + 46
	16  libdispatch.dylib                   0x98f122e3 _dispatch_main_queue_callback_4CF + 223
	17  CoreFoundation                      0x99bbac39 __CFRunLoopRun + 1961
	18  CoreFoundation                      0x99bba02a CFRunLoopRunSpecific + 378
	19  CoreFoundation                      0x99bb9e9b CFRunLoopRunInMode + 123
	20  HIToolbox                           0x91e16f5a RunCurrentEventLoopInMode + 242
	21  HIToolbox                           0x91e16cc9 ReceiveNextEventCommon + 374
	22  HIToolbox                           0x91e16b44 BlockUntilNextEventMatchingListInMode + 88
	23  AppKit                              0x976e99aa _DPSNextEvent + 724
	24  AppKit                              0x976e91dc -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 119
	25  AppKit                              0x976df63c -[NSApplication run] + 855
	26  Scroll-CRASH                        0x000198f5 SPffcall + 85
	27  ???                                 0x003cbfb0 0x0 + 3981232

	
28  ???                                 0x003cbfb0 0x0 + 3981232
	29  Scroll-CRASH                        0x00019f51 func_start + 94
	30  Scroll-CRASH                        0x0001c75e main + 910
	31  Scroll-CRASH                        0x0002fa51 _start + 208
	32  Scroll-CRASH                        0x0002f980 start + 40
	33  ???                                 0x00000002 0x0 + 2

Prof. Alexander Repenning

University of Colorado
Computer Science Department
Boulder, CO 80309-430

vCard: http://www.cs.colorado.edu/~ralex/AlexanderRepenning.vcf

Gmane